Share via


Retrieving current page number and total pages from Crystal Report

Question

Wednesday, February 21, 2007 11:48 PM

Hi,

Because the page navigation buttons of Crystal Report Viewer for VS 2005 is really bad (if I press the button to retrieve the last page, unless I keep my mouse over the button it won't process the request!!) I've had to create my own navigation buttons.  I have been able to do this successfully, but now I want to be able to show the user the number of pages in the crystal report and the current page number that they are on.  Similar to:

You are viewing page 10 of 299 

Is there any way of being able to do this??  I can't seem to find a way of extracting this information out of the either the CrystalReportViewer or from the ReportDocument.

All replies (3)

Thursday, February 22, 2007 12:29 AM âś…Answered

I was able to do this by accessing the relevant properties from the CrystalReportViewers ViewInfo object, as below:

CrystalDecisions.Web.ViewInfo vi = crViewer.ViewInfo;

pagenum.Text = vi.PageNumber + " of " + vi.LastPageNumber;


Monday, June 1, 2009 4:45 AM

not Working.


Tuesday, September 27, 2011 5:05 AM

hi ,

  It is possible to show both Current Page and Total No of page in Crystal Report Page Header. usuallly it shows 1/1+ .

To show Current page / Total No of page: Go To Your Solution Field Explorer->Special Fields From here Drag "Page N of M" To you Crystal Report.

That's it. It will work for u. No need to do any extra coding for it.

Regards

Gireesh