Thursday, 16 August 2012
I have recently been looking at conditional page breaks in SSRS 2008 r2 and did not know that it is possible to do via an expression.
For example if you have say 2 tables in a report and you want to conditionally force a page break between the 2 so that they appear separately on 2 pages based on a parameter.
This is possible, to do this first select the first table and then in the properties of the table under 'General' and then 'Pagebreak' change the break location to 'end'. This will then force a page break at the end of the table one.
To make the pagebreak conditional create a parameter called pagebreak with the available values of 'yes' and 'no'. Then in the properties for the table under the break location there is a field called 'Disabled' click on the dop down and select the expression option, in the expression box type the expression as:
When you run the report change the pagebreak parameter and you will see that this forces a page break when you select 'yes'.