Reputation: 4696
I'm using SQL Server Data Tools 2012 (Visual Studio 2010) and have a multi-tab report that does a page break on each combination of SalesTerritory and ProductType.
I can label the worksheet tabs of the resulting downloaded Excel spreadsheet by adding a group-level PageName property expression in the Properties window that concatenates the two current grouping criteria values:
=Lookup(Fields!SalesRegionID.Value, Fields!SalesRegionID.Value,
Fields!SalesRegionCode.Value, "SalesRegion") + " " +
Lookup(Fields!ProductTypeID.Value, Fields!ProductTypeID.Value,
Fields!ProductTypeName.Value, "ProductType")
What I'd like to do now is add the same string to the page header of each report page. I can't simply add the above expression in a text box since "field references outside of a data region must be contained within aggregate functions which specify a dataset scope."
So, how do I scope the references in order to display the same string on both current tab and the page header of each worksheet?
Upvotes: 0
Views: 5382
Reputation: 4696
It turns out that the PageName property that I assigned at the group level is also available as a global field. If you add a text box to the page header and open its expression dialog, you will find a field in the Built-in Fields category called "PageName". Double-clicking this will add the following expression:
"=Globals!PageName"
That does it!
Upvotes: 3