Solved

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

Posted on 2002-04-16
6
626 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6946864
Hi windyui,

goto the EndPage and check PageNumber property.

----
Igor
0
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 50 total points
ID: 6946930
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
ID: 6947081
but after calling Prepare, remember to free the QPrinter object :)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:windyui
ID: 6947091
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
ID: 6947386
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
ID: 6947924
OH!!!!!!!!@_@
   YES SIR. Thank you Marcos very much~~~^^

Windyui
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi : could not find program, '...exe' 2 213
find a node in VST 2 78
Installshield for Embarcadero EX 10.1 Berlin 4 72
Delphi Firemonkey send email on Android 1 41
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

749 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