Solved

Add page number to report

Posted on 2013-05-10
5
950 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 100 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 400 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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