Last post Apr 02, 2013 02:09 PM by nluciano75
Apr 02, 2013 01:39 PM|nluciano75|LINK
I have a web application in which I render one or more Crystal Reports and then merge them into one PDF. What I'd like to do is obtain the number of pages from one CrystalDecisions.CrystalReports.Engine.ReportDocument object then then set that value as a
parameter in the subsequent ReportDocument in order to continue the page numbering correctly. Does the ReportDocument class expose a way of obtaining the number of pages? If not, are there other ways?
I am NOT using a Crystal Report Viewer.
I am using CrystalReports for Visual Studio 2010 and C# .NET 4.
Apr 02, 2013 01:44 PM|Rion Williams|LINK
I'm not terribly familar with Crystal Reporting but this MSDN thread discusses using the following solution to get the total number
of pages within a document :
(This is highly untested from me but it may be worth a shot.)
Apr 02, 2013 02:09 PM|nluciano75|LINK
this is what i needed. i had seen this solution before but for some reason intellisense does not pick up the "FormatEngine" property after the ReportDocument (YourReport) and i thought that i was on the wrong track and that perhaps i had the wrong version
of the crystal reports object.
after typing "FormatEngine" the "GetLastPageNumber" method appeared and the code indeed returns the number of pages in the report.