Question

I have a reportviewer control that mostly works fine. I have only 1 issue with it though:
The page # of # (in the toolbar) doesnt show the correct total number of pages right from the start. It starts off with page 1 of 2, then when you go to the next page its page 2 of 3, then 3 of 4, etc. In my test the report actually had 46 pages. When I click go to last page button, it correctly goes to page 46. If I go to page 2 and then to page 1 again it shows 1 of 3.

I used the wizards to make a .xsd dataset and .rdlc report to use with the control.
The data is shown in a table that I put on the report with only 1 column to test with.

I tried searching on google but I cant seem to phrase my search so that I get this issue and not some other page number errors. Therefore I am unsure wether this is a bug or a setting I need to change or even just the way it is supposed to work.

Is there any way for me to make it show page 1 of 46 right from the start?

Was it helpful?

Solution

a little late in the answer to this but here goes (note that this only refers to the reportviewer 2010 control)

Changes in this version of the control mean that by default an estimate of the page count is generated. This is to improve performance. If you absolutley must get the accurate page count then you will need to set the PageCountMode to PageCountMode.Actual for the reportviewer control. This will probably slow the rendering of the report as the complete report must be processed to get this accurate count.

...from MSDN "Note that if you set PageCountMode to Actual, the entire report must be processed to get a valid page count, increasing wait time before the report is displayed."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top