I am using Crystal Report 2008 with C#, have a WinForm and want to show Page N of M to user in a Label.
How can I impelemnt that?
I searched and couldn't find any straightforward answer.
NOTICE: I used a CrystalReportViewer1 and CRGeneral.rpt
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
this way works well But i think I can Find better solution:
viewer.ShowLastPage();
string TotalPage = viewer.GetCurrentPageNumber().ToString();
viewer.ShowFirstPage();
pageNo.Text = viewer.GetCurrentPageNumber() + " of " + TotalPage;
Any Better Answer?
回答2:
Yes there is a better answer
viewer.pageView = (PageView)viewer.Controls[0];
var pagecount = viewer.pageView.GetLastPageNumber();
Source Take Control of Crystal Report Viewer