Link to home
Start Free TrialLog in
Avatar of Rog D
Rog DFlag for United States of America

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?
Avatar of Mike McCracken
Mike McCracken

What version of Crystal?

mlmcc
Avatar of Rog D

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
Mike, I think it still supports TotalPageCount, but I haven't test it on a web page.

Bob
I don't have the .Net version or web pages to test against.

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
Avatar of Rog D

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
Well, there you are--proof that it doesn't work (bummer).

Bob
Avatar of Rog D

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+
ASKER CERTIFIED SOLUTION
Avatar of djaniszyn
djaniszyn
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial