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;