?
Solved

Help with including page numbers in a report

Posted on 2012-03-30
9
Medium Priority
?
428 Views
Last Modified: 2012-03-31
Hello,

I am using MS Report with VS2008, the data is in table format. How do <i include page numbers at the page footer or table footer?

Victor
0
Comment
Question by:vcharles
[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
  • 4
  • 4
9 Comments
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37787884
="Page " & Globals!PageNumber & " of " & Globals!TotalPages.ToString

Open in new window


Or you can use functions:

Go to "Report" -> "Report Properties" -> "Code"

In the Custom Code section, enter the following:

Public Funtion PageNumber() as String
     Dim str as String
     str = Me.Report.Globals!PageNumber.ToString()
     Return str
End Function

Public Function TotalPages() as String
     Dim str as String
     str = Me.Report.Globals!TotalPages.ToString()
     Return str
End Function

Open in new window


To display the page number and total pages in a textbox located in the footer simply enter this for the value:

="Page " + Code.PageNumber() + " of " + Code.TotalPages()

Open in new window

0
 

Author Comment

by:vcharles
ID: 37788017
Thanks. After I drag the textbox to the footer section where do´I enter  

="Page " & Globals!PageNumber & " of " & Globals!TotalPages.ToString?
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37788056
Just create a textbox like you have done, right-click on it, click expressions and there.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:vcharles
ID: 37788065
I went to Report properties and inlcuded the code above but I got the following error message:

Error      2      There is an error on line 0 of custom code: [BC30205] End of statement expected.      

How do I fix this error?
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37788077
which code are you using?

The custom code or the expression?

If the expression, the more appropriate location is right-click on your textbox, properties, there where it says repeat on every page.
0
 

Author Comment

by:vcharles
ID: 37788113
'I tried both, will try your last suggestion and get back to you later. Thanks.
0
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 2000 total points
ID: 37788141
You have to ensure that your textbox is *below* the footer.

In other words, click Report at the top, Page Footer

Then drag a textbox anywhere on the report, right-click on it, on the Value, That's what I meant last time, on the Value box, enter the following:

="Page " + Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString()

or the one from custom code.

Finally, drag the textbox just below your footer and it should work.
0
 

Author Comment

by:vcharles
ID: 37791245
It worked. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

752 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