Solved

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

Posted on 2002-04-16
6
631 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
Independent Software Vendors: 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month4 days, 10 hours left to enroll

635 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