Q. How can I determine the number of pages in my report before I preview or print it?
A. If you call the report's Prepare method, it will generate the report without printing or previewing it. After Prepare has finished, the pagecount will be in the report's qrprinter.pagecount property. Please refer to the manual topic on Prepare for more information.
Example:
QuickRep1.Prepare;
QuickRep1.ReportTitle := 'This report has ' +
IntToStr(QuickRep1.QRPrinter.PageCount) + ' pages';
QuickRep1.QRPrinter.Free;
QuickRep1.QRPrinter := nil;
QuickRep1.Preview;
------------------
Partager