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
Solved

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

Posted on 2002-04-16
6
625 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
Multi-layered image in FireMonkey 9 48
scroll down TListBox component in Delphi 1 19
DBCtrlGrid, Delphi, Scroll 8 37
firemonkey Android Listview Sort items 7 49
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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