Current archive: 2003.05.01;
DX: QuickReport351. The problem with counting pages before viewing Find similar branches← →
MaxSit (2003-04-17 19:01) 
Before viewing the document, you need to know the number of pages in the generated report.
I used to do this:
PageCount: = Form1.QuickRep1.QRPrinter.PageCount;
Form1.QuickRep1.Preview; // when building using PageCount
But, when reports began on 200-300 pages, then use
Prepare became unbearable, because it runs as much as the Preview. On this site I found: << How to insert in "QuickReports" Page No. of ">>. There it is suggested to use:
, but I do not have qrsPageCount, I looked at older versions of QR, it is also absent there.
What are the ideas. Thank you in advance.
Anatoly Podgoretsky (2003-04-17 19:37) 
But there is a PageCount for QrPrinter, but where did they get the qrsPageCount, probably delirious.
And tell me you are doing QuickRep1.Prepare; so waste time.
MaxSit (2003-04-17 19:54) 
The fact is that if you do this:
Form1.QuickRep1.Tag: = Form1.QuickRep1.QRPrinter.PageCount;
crashes AV error on the first line.
This is how it works:
MaxSit (2003-04-17 19:58) 
Form1.QuickRep1.Tag - this is my PageCount variable
Anatoly Podgoretsky (2003-04-17 20:28) 
And why do you need a separate variable, when the value is right in QuickRep1.QRPrinter.PageCount; at any time directly accessible.
MaxSit (2003-04-17 20:38) 
Precisely in order to fill out a preview on each page: "PageNo Page of PageCount".
If this filling is hanged on the print event of the QRLabel itself, then we will see the following:
Page 1 from 1
Page 1 from 2
Page 1 from 3
Page 1 from 100
and only after the formation of the entire document, we will get a real QuickRep1.QRPrinter.PageCount.
Anatoly Podgoretsky (2003-04-17 20:59) 
This part is done by Prepare.
And with QRPrinter you have to be more cautious, it is installed in NIL in many places, therefore access to it is very dangerous.
Anatoly Podgoretsky (2003-04-17 21:03) 
You will have two / three times the formation of pages, prepare, preview, print
The loss of time is terrible.
MaxSit (2003-04-17 21:49) 
QR karyavy, I certainly agree, well, there are no other options yet. And I have been using QR for a long time, we are with you (Anatoly Podgoretsky) not for the first time discussing this issue. To redo the entire project under the new generator is not yet possible.
And customers require that each page have a signature of the number of pages and the current page, and somewhere they are right, this is convenient.
Anatoly Podgoretsky (2003-04-17 22:26) 
MaxSit © (17.04.03 21: 49)
It’s impossible to tell what is squatting, but you have to understand what you are doing, in this case, clearly, the QRPrinter is at this stage equal to NIL-
Here's what the FAQ says.
QuickRep1.ReportTitle: = "This report has" +
IntToStr (QuickRep1.QRPrinter.PageCount) + "pages";
QuickRep1.QRPrinter: = nil;
This should help you.
MaxSit (2003-04-17 22:40) 
Yes, but again:
And so you want without him.
Johnmen (2003-04-18 00:04) 
To know in advance the total number of pages, you need to generate a report. So ? So. So the preliminary run is inevitable.
Despite the fact that we already have the image of the report, it does not quite satisfy us - it does not indicate the total number of pages. So we have to re-generate it, i.e. a second run is also inevitable ...
Pages: 1 whole branch
Current archive: 2003.05.01;
Memory: 0.59 MB
Time: 0.027 c