How to get report pages before printing or printing preview

zhaozj2021-02-11  216

We sometimes need to obtain the number of printed pages in the report before printing, such as we need to print a "total XX page XX page" in the header or footer, how do you implement it? Before the QuickRep generates Report, we cannot know the number of report pages, and QuickReport generates a report when printing or printing a preview. In other words, we only generate a report once before printing or printing previews to get the number of print pages. Generate reports The method is prepare. Refer to the following example: ... var nPageCount: integer; begin {...} Quickrep1.prepare; nPageCount: = QuickRep1.QRPrinter.pageCount; QuickRep1.Qrprinter.free; QuickRep1.qrprinter: = nil; {here to modify QuickRep1 Implement the "total xx page" ...} quickrep1.preview; {...} end;

转载请注明原文地址:https://www.9cbs.com/read-4210.html

New Post(0)