Reporting Services - Group Name in Page Header
Asked Answered
U

3

5

I have a report with one group (Office Name) which page breaks between each group - so the data for only one Office can appear on a given page. How do I get that Office Name to appear in the page header?

I tried creating a hidden textbox in the details section of the report which has the Office Name value and then referencing that in the Page Header, but I get the last Office Name value on page 1 and then it is blank on every other page.

Unchartered answered 10/3, 2009 at 20:49 Comment(0)
U
0

I got it to work and I'll post the answer in case someone else runs across this issue.

For some reason referencing the text box did not work, but when I put a hidden column in the table with the same value, I could then reference that in the Page Header.

Unchartered answered 10/3, 2009 at 20:54 Comment(0)
I
11

Today, at last I found another way to do this.

On the group that you specified the page break, in the properties window, expand the Group section. See Pagination in Reporting Services (Report Builder and SSRS)

You can set the BreakLocation property in the Tablix Properties, Rectangle Properties, or Group Properties dialog boxes, but you must set the Disabled, ResetPageNumber, and PageName properties in the Report Builder Properties pane.

You should see a PageName field. This field can be set to that of one of the field data values from the dataset used by the tablix.

Once you have set the PageName field, you can add a textbox to the Page Header/Footer and set the expression to use the PageName field. Built-in Globals and Users References (Report Builder and SSRS)

=Globals!PageName

This should then change on each group change, and be visible on each page.

I have realy struggled finding a good solution for this, so if I need to clear up the answer, please feel free to suggest this.

Instantaneity answered 11/3, 2014 at 9:56 Comment(2)
what if there are 2 or 3 values from the data region that you want to include in the header? It seems with this solution you will only be able to supply 1 value.Kamerad
Make notice, that it only works with report definition from 2010. It doesn't work with <Report xmlns="schemas.microsoft.com/sqlserver/reporting/2008/01/…">Ay
U
0

I got it to work and I'll post the answer in case someone else runs across this issue.

For some reason referencing the text box did not work, but when I put a hidden column in the table with the same value, I could then reference that in the Page Header.

Unchartered answered 10/3, 2009 at 20:54 Comment(0)
I
0

I am actually doing this in the footer and it worked! Thanks! Just wanted to add if you have multiple values you are trying to display in the header or footer, you can string them together with a delimiter in the pagename expression like

=Fields!FIELD1.Value + "|" + Fields!FIELD2.Value + "|" + Fields!FIELD3.Value + "|" + Fields!FIELD4.Value

Then you can create new fields (one for each value) and parse out each field like

=(Split(Globals!PageName, "|")).GetValue(0)
=(Split(Globals!PageName, "|")).GetValue(1)
=(Split(Globals!PageName, "|")).GetValue(2)
=(Split(Globals!PageName, "|")).GetValue(3) 
Impi answered 29/4, 2020 at 15:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.