Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add page number to report

Posted on 2013-05-10
5
Medium Priority
?
975 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

661 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