Rudy Rodarte . com

Information

This article was written on 02 Aug 2011, and is filled under SQL Blogs.

Current post is tagged

, , ,

Display a Page Count in SSRS

When creating SSRS reports, it is great to add informational things in the footer. To create a footer, simply right click anywhere outside of the report body, and click on:
Add Page Footer.
One item that I put in all of my SSRS reports is a Date Printed and a Page X of Y. Date printed is easy enough. You simply add a text box to the footer and use

=now()

as the expression. Next format the text box as you like and you’re done.
However, I hit a sang on the page x of y. SSRS was giving me an error with it’s built in field:

Globals!OverallTotalPages

After a bit of searching, I found that you have to use

Globals!TotalPages

instead of OverallTotalPages. Your text box expression will look like this:

="Page " & Globals!PageNumber & " of " & Globals!TotalPages

Now, your SSRS page footer is complete!

Rudy

Rudy Rodarte is a SQL Server Database professional based in Austin, TX. Over his career, Rudy has worked with SSRS, SSIS, performance tuning troubleshooting. When away from Keyboard, Rudy goes to Spurs and Baylor Bear sporting events.

More Posts - Website - Twitter

  • Mahmoud Badr

    Thank you! Really helpful.

  • Mitch

    I have a report that has a page footer containing two text boxes. Each text box has an expression to print some fixed format text at the bottom of the report. However, when I export to Excel, the text is missing. What do I need to do to get this to export correctly?

  • Mitch, take a look at this page: http://stackoverflow.com/questions/1062199/report-footer-is-not-exported-to-excel
    The footers are there, but you need to switch excel from Normal to Page Layout under the View menu. Also, you can see the headers and footers when you use Print Preview. Hope that helps!

  • Ajay

    Thanks Sir Ji

  • Rich

    Ace! Very cool tip. Thank you!