Solved

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

Posted on 2002-04-16
6
624 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 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