Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add page number to report

Posted on 2013-05-10
5
Medium Priority
?
987 Views
Last Modified: 2013-05-14
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.
0
Comment
Question by:allelopath
  • 2
  • 2
5 Comments
 
LVL 41

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 400 total points
ID: 39156367
Unfortunately you can only put the page number in the header and footer.

You could work out some kind of formula if you knew the record count per page.

EG:  If you're dataset was 120 and each page had 20 records

you could figure it out as

floor ((record number - 1) / records per page) + 1.
0
 
LVL 27

Expert Comment

by:planocz
ID: 39158930
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.
0
 
LVL 1

Author Comment

by:allelopath
ID: 39161455
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.
0
 
LVL 1

Author Comment

by:allelopath
ID: 39161506
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.
0
 
LVL 27

Accepted Solution

by:
planocz earned 1600 total points
ID: 39161640
All you have to do is add group name

=(ReportItems!PageText.Value,"Mygroupname")

Your second answer is true you can only use in footer or header.
So you have that in the footer, but it is hidden inside a textbox with the name of the textbox like "PageText"
Then you call it from your body in the report ...
=(ReportItems!PageText.Value,"Mygroupname")  <--- expression in one of your body textboxes.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question