Solved

Quick Report..Can I get the PageCount before printing????

Posted on 2002-04-16
6
620 Views
Last Modified: 2009-01-22
hihi...
    I want to print the PageCount before I print some reports,that means I have to calculate how many report will be printed before the reports are printed.,,Can I????? Because I want to show to user how many pages they are planing to print...
           HELP...
 
>_<
windyui
0
Comment
Question by:windyui
6 Comments
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
Hi windyui,

goto the EndPage and check PageNumber property.

----
Igor
0
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 50 total points
Comment Utility
You must do a Prepare before print like this:

Var
nPages:Integer;
...........

Application.CreateForm(TfrLstFichas, frLstFichas);
frlstfichas.ListaFichas.Prepare;
nPages:=frlstfichas.Listafichas.qrprinter.PageCount;


Now nPages has the total pages in the report.

Best Regards.
Marcos
0
 
LVL 14

Expert Comment

by:DragonSlayer
Comment Utility
but after calling Prepare, remember to free the QPrinter object :)
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:windyui
Comment Utility
hihi..
   It works fine. Thank you very much.
   Btw,I don't need to free the Qprinter Object if I really print out the data,isn't it?????


windyui
0
 
LVL 3

Expert Comment

by:marcoszorrilla
Comment Utility
Application.CreateForm(TfrLstFichas, frLstFichas);
frlstfichas.ListaFichas.Prepare;
nPages:=frlstfichas.Listafichas.qrprinter.PageCount;
frlstFichas.ListaFichas.Print;
frlstFichas.Close;

If you has the Qrprint over a form:
In the OnClose event of this form:

FreeAndNil(ListaFichas);
Action:=CaFree;

****FreeAndNil works with D5 and also D4 I think but not with D3.

Best Regards
Marcos
0
 

Author Comment

by:windyui
Comment Utility
OH!!!!!!!!@_@
   YES SIR. Thank you Marcos very much~~~^^

Windyui
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now