ASP.NET ReportViewer页码问题
我有一个报表查看器控件,大部分工作正常。不过我只有 1 个问题:
第 # 页(共 # 页)(在工具栏中)从一开始就没有显示正确的总页数。它从第 1 页(共 2 页)开始,然后当您转到下一页时,它是第 2 页(共 3 页),然后是第 3 页(共 4 页),依此类推。在我的测试中,报告实际上有 46 页。当我单击“转到最后一页”按钮时,它会正确转到第 46 页。如果我转到第 2 页,然后再次转到第 1 页,它会显示第 1 页(共 3 页)。
我使用向导制作了 .xsd 数据集和 .rdlc 报告以供使用与控制。
数据显示在我放在报告中的表格中,仅用 1 列进行测试。
我尝试在谷歌上搜索,但我似乎无法表达我的搜索,这样我就会遇到这个问题,而不是其他一些页码错误。因此,我不确定这是否是一个错误或我需要更改的设置,甚至只是它应该工作的方式。
有什么办法可以让它从一开始就显示第 1 页(共 46 页)吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答这个问题有点晚了,但这里是(请注意,这仅指 reportviewer 2010 控件)
此版本的控件中的更改意味着默认情况下会生成页数的估计值。这是为了提高性能。如果您绝对必须获得准确的页数,那么您需要将报表查看器控件的 PageCountMode 设置为 PageCountMode.Actual。这可能会减慢报告的呈现速度,因为必须处理完整的报告才能获得准确的计数。
...来自 MSDN“请注意,如果将 PageCountMode 设置为实际,则必须处理整个报告才能获得有效的页数,从而增加显示报告之前的等待时间。”
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."