KDK
KDK

Reputation: 1

Values not displaying in SSRS report header when multiple subreports display on page

The values are displaying correctly in my page header with First(ReportItems!a_dept.Value) except on pages where my detail line is not displayed. My report has group footers that have two lines, one with a description of the footer information and one with a subreport with the details of the subtotals for that group footer. When multiple group footers/subtotals display on the page (one for division level, and one for department level for example), it takes up most of the page, so no detail line is displayed, so there is no values for First(ReportItems!a_dept.Value). I tried adding hidden fields to the group footer description lines, and then adding an IIF/IS NULL calculation to the page header to display the value based on the footer that was displaying, but I received an error saying "The Value expression for the textrun refers to more than one report item. An expression in a page header or footer can refer to only one report item." Does anyone have any other ideas?

Upvotes: 0

Views: 1289

Answers (2)

ARLibertarian
ARLibertarian

Reputation: 167

I got the error trying to ascertain whether the value existed.

If my tablix bleed over to a new page, the value was no longer available to display in the header.

=IIF(IsNothing(ReportItems!txtHIDDENName.Value),
     Previous(ReportItems!txtHIDDENName.Value), 
     ReportItems!txtHIDDENName.Value)

This did not work.

Upvotes: 0

Breian Wells
Breian Wells

Reputation: 111

The problem is that you have two ReportItems!a_dept.Value on the page based on the errors you described. There is a second way to access report items that returns a collection for the header and footer.

First(ReportItems("a_dept").Value)

The second access method comes from https://learn.microsoft.com/en-us/sql/reporting-services/report-design/built-in-collections-reportitems-collection-references-report-builder?view=sql-server-2017

Upvotes: 0

Related Questions