locked
Make whole SSRS report repeat by groups RRS feed

  • Question

  • User1373771044 posted

    I'm not really sure of the best title for this question.

    I have a particular problem that seems pretty common but I haven't found a way to solve it yet.

    Let's say I have an rdlc report for customers, and it has three sections with subreports:

    CUSTOMER_INFO (name, phone, e-mail)

    ITEMS

    OBSERVATIONS

    As the page only has 21cm and the report grows horizontally, I need to repeat the WHOLE report with all of its sections after every 4 customers. So if I have 5 customers, there would be three pages(let's say every subreport takes 1 page) for the first four customers, and then another three pages(with every section once again) just for one customer.

    Is it possible? It doesn't seem somehing out of the ordinary, but I can't figure how to make it work. Everytime there is more than 4 customers, the report breaks its layout trying to accommodate the records in a new table below the tables of each subreport. The expected result would be to bring all of exceeding data to new pages.

    I made a fiddle to picture exactly what I'm trying to achieve:
    Report as it is at the moment:
    http://jsfiddle.net/Lx9qpyue/2/

    Report as it has to be:
    http://jsfiddle.net/n46guf3e/

    Thanks in advance.

    Sunday, June 14, 2015 8:58 AM

All replies

  • User1711366110 posted

    Is it possible? It doesn't seem somehing out of the ordinary, but I can't figure how to make it work. Everytime there is more than 4 customers, the report breaks its layout trying to accommodate the records in a new table below the tables of each subreport. The expected result would be to bring all of exceeding data to new pages.

       As per this case, you can do the following steps which may guide you to resolve this case:

    Step 1:  Add a matrix to your report

    Step 2:  Add static rows to the matrix

    Right-click in the Data cell and select "Add Row".  Repeat for the number of fixed rows you want.

    Step 3:  Drag fields into the Data cells

    You'll notice that the design tool automatically wraps your field reference in the "First" aggregate (e.g. =First(Fields!CustomerName.Value

    Step 4:  Add a column grouping

    Right-click on the column header and select "Edit Group".  Enter this for the group expression: =RowNumber(Nothing). This will cause the matrix to give you one column per row of data. Since horizontal tables can end up rather wide, you probably want your table wrap around to the next "line" after a specific number of columns.

     Step 5:  Put the table into a list

    Add a list to your report and drag the table into it

    Step 6:  Group by a number of rows

    Right-click on the list and select Properties.  Then click on Edit Details Group.

    Enter this for the group expression: =Ceiling(RowNumber(Nothing)/4)

    This will cause the list to group on every four rows.  So you'll get a separate table for every four rows.

     Step 7:  Adjust the group expression in the matrix

    Edit the column group expression in your matrix and change the RowNumber argument to be the list group name.

    For example: =RowNumber("list1_Details_Group")

    Sunday, June 14, 2015 10:44 PM
  • User1373771044 posted

    Thanks for the great reply, but I'm still facing a problem.

    I have created the list and put everything I had inside, including all the subreports.

    First problem: I can't define the function =RowNumber("list1_Details_Group") on my subreports, as they are in a different scope.Second problem: If I send the result of this function as a parameter, it doesn't give me the expected result.

    The best I got trying this solution was to repeat the whole page as many time as needed(great), but with the same content(so the same clients per page).

    Tuesday, June 16, 2015 1:40 PM