Conditional Page breaks at group level in SSRS2008

2020-06-17 04:11发布

问题:

I have a report in SSRS 2008 R2. This report consists of one table containing several grouping levels. If the customer requests to see all the detail them I want a page break at the second grouping level of the table. If only the summary details are requested then I do not want the page break as that will cause unnecessary paging. How can I conditionally control the page break at the group level in a table?

The summary details are calculated and returned differently from the sql so I do not want to hide rows, just turn page break on or off.

回答1:

You can use expression based page breaks, which, depending on your exact table setup, might be useful.

Basically, you set up a parameter to control whether page breaks are applied.

At the Group level, there are Page Break options - set the Page Break property to what you require, then set the Disabled property to be expression based, something like:

=IIf(Parameters!Break.Value, false, true)

This means the Page Break will only be applied of the Break parameter is set to true.