SSRS Reports - force table to expand to bottom of page

后端 未结 4 1760
死守一世寂寞
死守一世寂寞 2021-02-14 04:28

I\'m trying to create a invoice type report where i have a header, main body with a table (which includes a totals section) and footer.

The problem im getting is, the ta

4条回答
  •  迷失自我
    2021-02-14 04:52

    In the end I've settled for a solution which is very close to what I need and involves in using hidden elements. (similar to what Dan Andrews suggested - but catered to what I needed)

    So first of all, I have included the totals in the footer of the report so that it stays at the bottom all the time.

    This is shown below:

    Within the subtotals footer, I have placed a message "Continued on next page" which is also a hidden field - this is so I can show this message on any reports that have more than 1 page showing (hence the user knows there's more than 1 page for the report and so the blank space doesn't look as bad).

    To hide the totals field, I have the following expression in the "hidden" property:

    =iif(Globals!PageNumber=Globals!TotalPages,false,true)
    

    And for the "continued" field:

    =iif(Globals!PageNumber=Globals!TotalPages,true,false)
    

    Now the problem with this is that the footer does not know what the tallied up values are from the table due to the footer not having access to the table in the report body.

    To get around this issue, I have created a "totals" section which is part of the table that does all the calculation I need to show on the footer.

    I put a name for each of the text boxes that I need access to in the footer like so:

    And on the corresponding footer element, I have the expression like so:

    Now that the footer contains the totals, the totals field is always shown at the bottom regardless of how big the table grows (which was my initial problem - the footer being placed wherever it wanted to go) with a small trade off of having a blank space on any pages that's not the last. I have put in a "continued on next page" message there instead which shows that there are more pages to the report and so it looks like the white space is being used.

    This is a single page example:

    And this is a multi page example:

提交回复
热议问题