Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem identifying the last report page

edited October 2007 in General
Hi,
I needed to identify the last report page to hide certain graphics on it. I
was told to use the following technique: on before print event for report
header compare page number with page count. So it looks like

procedure TForm1.ppHeaderBand1BeforePrint(Sender: TObject);
begin
ppLine2.Visible := TransactionReport.Page <> TransactionReport.PageCount;
end;

which actually initially worked and did exactly what I needed. Then I ran
into a problem (maybe it is related to the large reports) where it did not
work. It looks like as report gets created it does not know how many pages
to expect so for each page its number basically equals to the page count. If
I pop up report preview and scroll pages back and forth then it works, But
for the first initial print all ppLine2 controls are not printed.

I checked report control and did not find a straight option such as
'generate whole report before printing'. So did I miss something? Or maybe
there is another way to track the last report page?

Thanks,
Serge Goupinets

Comments

This discussion has been closed.