Link to home
Start Free TrialLog in
Avatar of allelopath
allelopath

asked on

Add page number to report

I want to add a page number report. This page shows how to add a page number to a header or footer. Instead, I want to add it to a text box, or somehow else put the page number in a particular location on the page.
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can try this... First Create your Textbox to hold the page number name it like "PageText"
Then in the footer hide your page number textbox (Globals!PageNumber).

Then back in the textbox named "PageText" place this expression in the textbox.
=ReportItems!PageText.Value
this should show the page number of the page that you are viewing.
Avatar of allelopath
allelopath

ASKER

planocz:
Kudos for creative thinking, but I think SSRS doesn't like it. It gives this error:
Report item expressions can only refer to other report items within the same grouping scope.
So I guess an expression in the 'body' cannot refer to something in the header/footer.
Similarly, as ged325 alludes to, if I try something using the Built-in Fields:
="Page " & Globals!PageNumber & " of "& Globals!TotalPages
It gives the error:
The Value expression for the textrun refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer.
So they are not global variables at all.

I wonder if it is possible to make a dataset referring to global variables.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial