0
votes

I have a ssrs report with multiple rectangles.

Each rectangle has "add page break after" property checked. Each rectangle may or may not be visible based on certain conditions.

I want to get rid of the last blank page in the report.

I already set the ConsumeContainerWhitespace to true.

I can't think of another way to get each rectangle on different page and yet having no extra page.

1
Are there any objects on your report that are displayed unconditionally, and if so, where are they displayed - at the start?user359040
@MarkBannister No one Mark, can you please explain what kind of hack you have in mind? :)Stuntman
Unfortunately, what I had in mind was changing all the page break after settings to be page break before - but that won't work if every object on the report is printed conditionally; you would have a blank page at the start of the report (instead of the end).user359040

1 Answers

2
votes

Components that have the PageBreak property also have the Disabled sub-property. The result must be either True or False. When set to True, the page break will not occur. So what you would need to do is concatenate the other components' visibility conditions into one big condition in the Disabled property of the page break. Here's what it looks like in the RDL file (my example will always prevent the page break) :

<PageBreak>
  <BreakLocation>End</BreakLocation>
  <Disabled>=IIF(1=1, True, False)</Disabled>
</PageBreak>