How to force reprint in OnEndFirstPass
Hi,
All I want to do is to determine the width of report.
I want to have whole row on one page so I want to set PaperWidth to
width of the report in a preview mode.
I try to do it like this:
procedure TDM.ReportEndFirstPass(Sender: TObject);
begin
if FPageCount <> Report.PageCount then begin
FPageCount := Report.PageCount;
Report.PrinterSetup.PaperWidth := Report.PrinterSetup.PaperWidth*2
// here I want to force reprint or just repeat first pass that will use
new value of PaperWidth ??
rbPredObdObiskInkaso.PageLimitReached;
rbPredObdObiskInkaso.ResetDevices;
end;
end;
If there is any other way to implement this kind of behavior please help.
best regards
M. Matej
All I want to do is to determine the width of report.
I want to have whole row on one page so I want to set PaperWidth to
width of the report in a preview mode.
I try to do it like this:
procedure TDM.ReportEndFirstPass(Sender: TObject);
begin
if FPageCount <> Report.PageCount then begin
FPageCount := Report.PageCount;
Report.PrinterSetup.PaperWidth := Report.PrinterSetup.PaperWidth*2
// here I want to force reprint or just repeat first pass that will use
new value of PaperWidth ??
rbPredObdObiskInkaso.PageLimitReached;
rbPredObdObiskInkaso.ResetDevices;
end;
end;
If there is any other way to implement this kind of behavior please help.
best regards
M. Matej
This discussion has been closed.
Comments
I am unclear about what you are trying to accomplish. Why is it necessary
to chang the paper sized after the first pass of the report. Also, the
preview will reflect the paper size when ever you decide to set its value.
You can also try calling Report.Reset to regenerate the report.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
withot horizontal split wich I don't want to have because the report
becomes unreadable.
I want whole report on one page (without horizontal split -> PaperWidth
= Report width) also in preview (that is also necessary when exporting
to excel).
As I figure it out the only way to calculate the actual width of report
is after first pass when pages are generated. I can do that somehow but
I don't know how to force report to be generated again from the start
(first pass).
When I call Report.Reset, .ResetDevices, .PageLimitedReached or .Stop
report always countinues with second pass so I get very strange looking
preview (after first pass I have 20 pages and when I change paperwidth I
get 10 pages while preview has 20 pages: first ten from new paperwidth
value and last ten from old paperwidth value).
1.) After first pass how to force report to be regenerated from start
2.) Is there any easy way to set paperwidth to report width and
paperheight to report height?
3.) When printing to file there is no need for pages (at least in most
cases: excel, text, ...) so how can I change paperwidth and paperheight
when printing to file is selected from preview form?
Thanks for the explaination. Unfortunately the entire report generation
process in ReportBuilder relies on knowing the page size before the report
is generated. After the first pass, the report width is calculated but
there is no way to reset the paperwidth as the report engine has alread used
the current paper width to make the page calculations. It is also
impossible to regenerate the entire report after the first pass.
One way to accomplish this would be to calculate the report width before
trying to print the report. If you are placing dynamically sized images or
columns in a report, you can use the positioning of these components at runt
time in conjunction with the amount of data you have to make a calculation
of how wide the report is going to be and then set the size of the paper
accordingly.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com