Conditional Page Break
Hi Chintak, Thank You for your prompt response. Your response works great to display 2 ID's per page meaning ID 1 & 2 and likewise 3 & 4 in next page. Now I want to display 3 or 4 ID's per page, I change the expression to :- = iif(Fields!ID.Value MOD 3 = 0 , true, false)-- for 3 ID's per page = iif(Fields!ID.Value MOD 4 = 0 , true, false)-- for 4 ID's per page But above expression didn't work, can you please help me out? Where I'm doing wrong? Thanks in advance ApexPlease do let us know your feedback. Thank You - KG, MCTS
June 19th, 2012 2:17pm

Experts, I have some sample table values as:- CREATE TABLE #TEMP ( ID INT, SRC VARCHAR(10) ) INSERT INTO #TEMP VALUES ( 1, 'DW' ) INSERT INTO #TEMP VALUES ( 1, 'CRM' ) INSERT INTO #TEMP VALUES ( 1, 'BI' ) INSERT INTO #TEMP VALUES ( 1, 'BA' ) INSERT INTO #TEMP VALUES ( 2, 'DW' ) INSERT INTO #TEMP VALUES ( 2, 'CRM' ) INSERT INTO #TEMP VALUES ( 2, 'BI' ) --Upto here on 1st page INSERT INTO #TEMP VALUES ( 3, 'DW' ) INSERT INTO #TEMP VALUES ( 3, 'CRM' ) INSERT INTO #TEMP VALUES ( 3, 'BA' ) INSERT INTO #TEMP VALUES ( 3, 'BI' ) INSERT INTO #TEMP VALUES ( 3, 'HR' ) INSERT INTO #TEMP VALUES ( 3, 'ORACLE' ) INSERT INTO #TEMP VALUES ( 4, 'ORACLE' ) INSERT INTO #TEMP VALUES ( 4, 'HR' ) --Upto here on 2nd page SELECT * FROM #TEMP DROP TABLE #TEMP I want to display only two group's per page (1 & 2 ID values on 1st page likewise 3 & 4 ID values on 2nd page). How Can I do that? Any help please? Thanks in advance. ApexPlease do let us know your feedback. Thank You - KG, MCTS
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 9:55am

Hi Again, Now MOD 3 expression works but NOT MOD 4. Thanks ApexPlease do let us know your feedback. Thank You - KG, MCTS
June 20th, 2012 10:25am

Hi, You can do this by setting custom expression for page break from properties. Set PageBreak locaction to Between & set Disabled to expression = iif(Fields!ID.Value MOD 2 = 0 , true, false) as shown below. - Chintak (My Blog)
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 10:35am

This article should guide on your problem: http://mohitnayyar.blogspot.com/2009/05/conditional-page-break-in-ssrs.html
June 20th, 2012 10:35am

Hi Chintak, Thank You for your prompt response. Your response works great to display 2 ID's per page meaning ID 1 & 2 and likewise 3 & 4 in next page. Now I want to display 3 or 4 ID's per page, I change the expression to :- = iif(Fields!ID.Value MOD 3 = 0 , true, false)-- for 3 ID's per page = iif(Fields!ID.Value MOD 4 = 0 , true, false)-- for 4 ID's per page But above expression didn't work, can you please help me out? Where I'm doing wrong? Thanks in advance ApexPlease do let us know your feedback. Thank You - KG, MCTS
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 2:35pm

Hello Kumar, The formula menotioned above is working for any number. For that I have created one parameter for pagebreak and added it to the report. =iif( (Fields!ID.Value-1) MOD Parameters!PageBreakAfter.Value> 0 , true,false) I have verified pagebreaks for parameter value 1 to 8 and its working correctly. You can also download the file from sky drive http://sdrv.ms/LluJRU I am doing this on RB 3.0 (SSRS 2008 R2), Which version you are using? - Chintak (My Blog)
June 21st, 2012 2:55am

Hello Kumar, The formula menotioned above is working for any number. For that I have created one parameter for pagebreak and added it to the report. =iif( (Fields!ID.Value-1) MOD Parameters!PageBreakAfter.Value> 0 , true,false) I have verified pagebreaks for parameter value 1 to 8 and its working correctly. You can also download the file from sky drive http://sdrv.ms/LluJRU I am doing this on RB 3.0 (SSRS 2008 R2), Which version you are using? - Chintak (My Blog)
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2012 3:18am

Hello Kumar, Change your expression to : =iif( (Fields!ID.Value-1) MOD 3 > 0 , true,false) For after 4, change your expression to: =iif( (Fields!ID.Value-1) MOD 4 > 0 , true,false)- Chintak (My Blog)
June 21st, 2012 6:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics