Solved

Add page number to report

Posted on 2013-05-10
5
928 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptons in Microsoft Reporting Services. I did manage to find one article showing you how your could make a s…
Steps to solve SSRS SQL 2008 R2 User Access Control (UAC) Permission Error With the introduction of SQL Server 2008 R2 and Vista (Windows 7 as well) came new enhanced security features. One of the features included was User Access Control (UAC) t…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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