Rog D
asked on
Get the number of pages in asp.net Crystal Report
I would like to Get the Number of pages in asp.net Crystal Report. I want to show it on my aspx form along with the report. I don't want to use the toolbar, so I figured I could easily get this number.
It seems tricky, but maybe someone knows how?
It seems tricky, but maybe someone knows how?
ASKER
Visual Studio 2005 Cryatal 10?
I suspect the value may not be available. Crystal.Net (the Crystal distributed with Visual Studio) is limited in some respects.
mlmcc
mlmcc
Mike, I think it still supports TotalPageCount, but I haven't test it on a web page.
Bob
Bob
I don't have the .Net version or web pages to test against.
mlmcc
mlmcc
We both "know" someone who does *WINK*, so we can approach this as if it were a standard Crystal report, and see if I was right.
Bob
Bob
ASKER
The "TotalPageCount" is not a property of the CrystalreportDocument object or the CrystalReportViewer at least in the ASP.net version of these objects.
Rog
Rog
Well, there you are--proof that it doesn't work (bummer).
Bob
Bob
ASKER
No Answer was givin but will give points to close out question.
There are two ways in which to achieve this. The first (non recommended) rather crude way is to move to the last page then directly to the first page. Something like:
crViewer.ShowLastPage();
crViewer.ShowFirstPage();
where crViewer is your crystal report viewer.
The better way to handle this is to simply change the page number at the bottom of the report (defaults to just the page number) to displaying the special field "Page N of M". This can be found in the field explorer under "Special Fields". The crystal report viewer toolbar then picks this up and displays the correct end page instead of 1+
crViewer.ShowLastPage();
crViewer.ShowFirstPage();
where crViewer is your crystal report viewer.
The better way to handle this is to simply change the page number at the bottom of the report (defaults to just the page number) to displaying the special field "Page N of M". This can be found in the field explorer under "Special Fields". The crystal report viewer toolbar then picks this up and displays the correct end page instead of 1+
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mlmcc