Total Pages Incorrect when printing but correct on Report Server and in Visual Studio
I have run into a problem with page numbers. Two different problems as a matter of fact. Recently upgraded from SQL 2008 to SQL 2008 R2. All of our reports that used Globals!TotalPages started printing "0" on all pages when printed (but displayed correctly in Visual Studio preview and when running the report via IE). To get around this for now I am using Globals!OverallTotalPages because that prints correctly. The other issue has to do specificially with Globals!PageNumber and Globals!TotalPages. On a report I am utilizing R2's new ability to reset page count when groups change. This feature works beautifully, most of the time. But for some records, seemingly randomly, I am getting incorrect numbers ONLY when printing. It will say, "1 of 3", "2 of 3", "3 of 3"...but then what should have been a 4th page will show up as "1 of 1". It doesn't do this all the time, and as I said ONLY happens when printed. On screen in Visual studio and IE the numbers are 100% accurate. Server: SQL Server 2008 R2 on Windows 2008 SP1 64bit Client: Various 64bit, 32bit, XP, Vista, and 7. IE 8.
June 24th, 2010 12:47am

Hi TravisHarrewithMcCain, As you may know, in Microsoft SQL Server Reporting Services 2008 R2, we have some enhancements about page numbers. One of them is the one you said -- "OverallTotalPage". OverallTotalPage: The total number of pages in the report. Can be used only in a page header and footer. Also, TotalPages built-in field has another definition. In SQL Server Reporting Services 2008 R2, the TotalPages has the following definition: The total number of pages in the current continous page sequence. The number can be reset by using page breaks. Can be used only in a page header and footer. From the description, we can know, in order to get total pages in SQL server Reporting Services 2008 R2, we need to use OverallTotalPage instead of TotalPages. For the other question, it should be caused by the 4th page is in another group. In this case, 1 of 1 is excepted. Of course, if the PageNumber is rendered correctly while previewing, but not printing, we should need to try to reproduce it. So, if possible, could you please send us the sample report and sample data? You could mail them to sqltnsp AT microsofot.com (Please replace AT with @) For more information about the new PageNumber feature, please see: http://blogs.msdn.com/b/robertbruckner/archive/2010/04/25/report-design-reset-page-number-on-group.aspx If you have any more questions, please feel free to ask. Thanks, Jin ChenJin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2010 10:35am

Thanks so much for this post, very helpful.
July 1st, 2010 5:04pm

hi Jin, Thank you for explaining about the changes to the behavior of the Globals!TotalPages variable in SSRS 2008 Release 2. We use the TotalPages variable on practically all our reports to do "Page x of Y" page numbering. I don't understand how Microsoft made a decision that would "break" all existing reports developed in R1 when the SSRS server is upgraded to R2. Our reports now say "Page 1 of 0" instead of "Page 1 of 2". Are you saying that we must go back and edit all our reports, to change Globals!TotalPages to Globals!OverallTotalPages? Furthermore, when developing and testing reports in Visual Studio 2008 (with R2 functionality), the Globals!TotalPages DOES show the total number of pages. But when the .RDL is deployed to the SSRS 2008 R2 server, the total number of pages always shows 0. How is it acceptable that such an important variable works one way in Visual Studio 2008 and another way when deployed?
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2011 4:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics