0
votes

I work with ssrs with a dynamic row data in matrix/tablix. There is possibility when I have more than one page (say it two pages) where the data just fill half of the second page and leave a blank space below (half page blank space on the second page). How is the way to fill this blank space with empty rows? (whether rendering empty rows in the tablix, or inserting background image, or anything. I don't have any solution yet as it is dynamic data with many possibilities of the blank space size on the page)

1
Why would you want to out of curiosity? Seems to me that putting in these extra rows with nothing in them, and the potential to have summary aggregate data in totals rows in combination with groupings would create more problems than acceptable for such a weird requirement.Mark W

1 Answers

1
votes

Unfortunately there aren't any settings in the reporter that support this behavior. There are however several workarounds you could use to get the wanted result.

[1] You could determine the amount of rows that fit on the first page and on the second page, just in case you have items above the table on the first page. Before you send the datasource to the reporter count the total rows and check if it exceeds the first page. Then calculate the number of rows missing to fill an entire second page (or third/fourth... if you ever get more data). Finally you add empty rows/objects at the end of your datasource, which will of cource cause the pages to be filled to the end.

As was pointed out before, this solution is only possible when working with fixed row heights. If certain columns can have multi-line cells then these could be checked as well and taken in account when calculating the number of rows being displayed on the page. This makes it slightly more complicated but is still a valid solution if you can predict which columns might be troublesome.


[2] A second solution would be to hide the table borders and place the table inside a rectangle that spans the maximum size of the page. The borders of this rectangle can be used to display the table outer borders and columns can be displayed by adding lines inside the rectangle. This will cause the columns to fill the last page of the report automatically. Unfortunately this isn't a solution to display horizontal grid lines.


[3] A third approach is adding an extra table directly below your table with the same size of columns. Using the same method as from the first solution you could fill the second table to represent the empty rows. You'll probably have the same issue as with the first solution when dealing with multi-line rows though.


I believe solution [1] and [3] will offer the most exact solution, if you're willing to do the math. If you don't want any horizontal lines then I suggest using approach [2].
Using an image to overlay the borders is of course another option but then you'll have the same issues when dealing with the multi-line rows. If you plan on working with fixed row heights, where you leave space for multi-line cells then this is becomes a valid approach but so does solutions [1] and [3].

Update:
If you only need the filled pages for printing you could make sure you add enough empty rows to fill at least the entire last page, these may go to a new page (1 new page, not 2... you can use a simple calculated guess for this) and exclude the last page when printing.