【问题标题】:How to get Total Page Count in Reportviewer如何在 Reportviewer 中获取总页数
【发布时间】:2014-08-14 11:21:08
【问题描述】:

我正在开发一个窗口应用程序,我需要在 Rdlc 报告查看器中获取总页数。

所以请告诉我如何获得总页数。

这是我的代码,它不起作用并且总是显示 0:

Dim TotalPage As Integer = ReportViewer1.LocalReport.GetTotalPages(PageCountMode.Actual)
MsgBox(TotalPageAs)

在这张图片中,总页数是 6。

【问题讨论】:

  • 通常,您需要生成页面才能知道会有多少。至少运行分页逻辑来获得计数。在实际制作预览之前,也许是一个模拟打印周期来获得计数?

标签: c# .net vb.net rdlc


【解决方案1】:

尝试使用 ServerReport 而不是 LocalReport,如下所示:

ReportViewer.ServerReport.GetTotalPages() 

如需了解更多信息,请查看herehere

【讨论】:

  • 我正在开发窗口应用程序,我的数据库是 mysql 而不是 SQL Server
猜你喜欢
  • 2013-06-09
  • 2012-04-16
  • 1970-01-01
  • 2023-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-04
相关资源
最近更新 更多