Help with including page numbers in a report

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
vcharlesAsked:
Who is Participating?
 
sammySeltzerCommented:
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
 
sammySeltzerCommented:
="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
 
vcharlesAuthor Commented:
Thanks. After I drag the textbox to the footer section where do´I enter  

="Page " & Globals!PageNumber & " of " & Globals!TotalPages.ToString?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sammySeltzerCommented:
Just create a textbox like you have done, right-click on it, click expressions and there.
0
 
vcharlesAuthor Commented:
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
 
sammySeltzerCommented:
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
 
vcharlesAuthor Commented:
'I tried both, will try your last suggestion and get back to you later. Thanks.
0
 
vcharlesAuthor Commented:
It worked. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.