Link to home
Start Free TrialLog in
Avatar of ultrafish
ultrafish

asked on

get the total page count in the exported file

hi all,

I am using VS2002 (C#) and CR 8.5, does anyone have any idea on getting the total number of page of the exported file ?

I have a main report and subreport, I am exported as  pdf file after I get the report.
What I want is the total number of page of this pdf file (or we can get from the report).

Thanks
Avatar of ebolek
ebolek

You can get the total page count of the crystal reprot but not pdf. That is not possible.
for crystal reprot
there is a total page count function in the special fields of the field explorer. You can drag and drop it into your report and report will show the total count but it wont do it in pdf/
ASKER CERTIFIED SOLUTION
Avatar of EwaldL
EwaldL

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
Avatar of ultrafish

ASKER

Thanks,
what I mean is to get the total page count inside the C# code during run time.
here is the code I use the get the total page of the report. However it sometimes doesn't work and simply stop the execution of the program. Anyone know what's going on?

int totalPage;
totalPage = rptDoc.FormatEngine.GetLastPageNumber(new CrystalDecisions.Shared.ReportPageRequestContext());