Show total page count in RDLC report report panel

I have several reports using MS ReportViewer. Reports display the standard ReportViewer toolbar. This toolbar contains a page navigation section with back and forward buttons and the number of pages. For my reports, when they first download the report, they always show the number of pages per se:

1 of 2? 

The question icon means that it has not yet calculated the total number of pages, and if you go to the last page, this number will be updated. But I would like this report to show the total number of pages without having to go to the last page.

I looked at the RDLC properties and could not find any settings for this.

+7
source share
4 answers

You can add a text box to the header and footer and set it to Globals! TotalPages. This will cause the ssrs engine to process all pages at once. You can hide the text box.

Hope this helps.

+7
source

Another β€œclean” way to do this:

A question icon means that the displayed total page number is not the actual number of pages, but an estimate. The VS2010 Report Viewer, by default, generates the total number of pages as an estimate to improve performance. If you like, you can change the page counting mode to the actual one using the ReportViewer.PageCountMode property.

Source: http://social.msdn.microsoft.com/Forums/en-US/3070efeb-2eb1-4e16-a9d6-9ec8ecb36d94/reportviewer-page-controls-show-page-1-of-2-how-to- remove-question-mark? forum = vsreportcontrols

+7
source

There is a property called PageCountMode with the default value - Estimate, you can set it as Actual

0
source

A question icon means that the displayed total page number is not the actual number of pages, but an estimate. The VS2010 Report Viewer, by default, generates the total number of pages as an estimate to improve performance.

Thus, you can write the line below in your code after adding the data source for the report.

 ReportViewer1.PageCountMode = new PageCountMode(); 

ReportViewer1 is the identifier of my report view control.

0
source

All Articles