Sep 302013
 

Here’s an easy way to alter your group header on subsequent pages in SSRS, without using any custom code.

Step 1:  Add a row number by your grouping to the data set query
SELECT     
ROW_NUMBER() OVER(PARTITION BY Layout_Code ORDER BY Product_ID) AS Row
,[Layout_Code]
,[Product_ID]
,[Variant_Code]
  FROM[DIM_Product]
Step 2: Be sure your Row Group header is set to Repeat on New Page

Do this by selecting the small triangle at the top right of the grouping pane and turning on Advanced Mode.  Then select the Static member at the top of your group and set the RepeatOnNewPage property to True.

image

image

Step 3: Add the Row field in your report

Add the =First(Fields!Row.Value) field into the group header row of your report.  Call the textbox RowGroup.

Add the Row field into the detail row of your report. Call the text box RowDetail.

These fields will be hidden later.

image

Step 4: Add the Group Header expression

Set the Group Header expression like this:

=iif(ReportItems!RowGroup.Value=ReportItems!RowDetail.Value, Fields!Layout_Code.Value, Fields!Layout_Code.Value + ” Continued”)

Notice in the preview of the report that on the first page of the report the RowGroup textbox = 1 and the RowDetal textbox = 1.  The Iif statement dictates that the group header shows the Layout_Code value.

image

On page 2 of the report, since the Layout group continues and 1 <> 49, the work “Continued” is added to the group header.

image

This will carry on until a new group starts and the row number goes back to 1.  You can go ahead and resize and hide the column once you have the logic working.

Wordpress SEO Plugin by SEOPressor