This blog contains tips and tricks for reporting services 2005/2008R2/2016 "This blog is provided 'AS IS' with no warranties, and confers no rights."
Thursday, 16 August 2012
Conditional Page Breaks in SSRS 2008 r2
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:
=iif(Parameters!pagebreak.Value="no",True,False)
When you run the report change the pagebreak parameter and you will see that this forces a page break when you select 'yes'.
Subscribe to:
Post Comments (Atom)
Keep SSRS (SSRS2016) report manager awake
When running a report for the first time in report manager it takes a while to run, after this initial run reports run fine. There are a ...
-
Due to the fact the reporting services allows you to query the tables you can easily write SQL which will allow you to return data from the ...
-
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...
-
To add alternate colors in a matrix the expression should be as follows for the row group: =IIf( RunningValue (Fields!FIELDNAME.Value, Co...
This comment has been removed by the author.
ReplyDeleteThanks a lot for this valuable and straight forward answer..!
ReplyDeleteThank you!!
ReplyDeleteThanks. This is a seriously good trick to have in your arsenal, but not what I need this time. I don't want to grouping to go away, just the page-break after each one.
ReplyDeleteWe have a situation where there are two different reports being created at the same time. The first report can be one or more pages. Can a parameter be designed so that a blank page is created after this first report but ONLY if the subsequent page is odd. This will force the second report to always start on an even page. This is required for the print vendor who must start the second report on an even page as it is double sided printing. Let me know if I am not clear. Thank you
ReplyDeleteCorrection from business owner: I think you may have phrased this part backwards “Can a parameter be designed so that a blank page is created after this first report but ONLY if the subsequent page is odd. This will force the second report to always start on an even page. This is required for the print vendor who must start the second report on an even page as it is double sided printing. Let me know if I am not clear. Thank you”
ReplyDeleteThe subsequent report should start on an odd page such as 1, 3, 5 which would be the front side of the page. The even pages would be the back side of the page. So I think the question should read “Can a parameter be designed so that a blank page is created after this first report but ONLY if the subsequent page is even. This will force the second report to always start on an odd page. This is required for the print vendor who must start the second report on an odd page as it is double sided printing. Let me know if I am not clear. Thank you”