Search code examples
ssrs-2008-r2listitemsubreport

SSRS 2008 r2 - How do I repeat a sub-report for each row of data returned in the results set?


I have a main report with multiple sub reports. The 2nd and 3rd sub-report are inside a List item.

Main Report

The 2nd and 3rd sub reports are forms like this:

Sub Report Form

When I run the report I am getting a single table returned for sub-reports 2 and 3 with multiple results for each question like this:

Result

What I need is a single report returned with the entire sub report form repeated for each one of the highlighted result rows rather than lumping them together so that it looks something like this:

expected return

I think that it is to do with grouping but I cant work out where to do the grouping. Do I add a row group in the List Item? in the sub-report table row? or in the original sub-report data query? Nothing I have tried has worked so far. I can't seem to get it to group correctly.

Any help with pointing me in the right direction gratefully received.


Solution

  • I managed to sort this out for anyone who has the same issue - rather than adding the list item to the main report I went back and opened up the sub-report, added a list item to the right of the report and moved all of the items in the sub-report into the list item and then moved the list item containing everything back to the left. In the main report I added a normal subreport item and pulled in the links. Everything worked as expected and I now have the correct output