Re: Total Pages count

Tom Nesler <[email protected]> Wed, 4 Sep 2002 06:28:03 -0700 (PDT)
Newsgroups gmane.comp.lang.delphi.quick-reports
Message-ID <[email protected]>
Hi Monir!
--- Monir-SCS <[email protected]> wrote:
> Hi,
> I want to print the total number of pages in the title of Quick
> Report, the
> QRSysData print current page number only, any idea how?
> 
> Monir.

What you need to do is use the Prepare option to capture the total
number of pages and put it in a global variable.  Prepare 'prints' your
report but does not display it.  Here is an example (From the QR FAQ
section).

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 TCustomQuickRep.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;

In This example the data is put in the Title but you could put it inot
a label on your page header band.

Good Luck!

=====
Tom Nesler

Live Long...Code Well... and Prosper! V

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com