TECH TIP: Using PrintOnFirstPage for One Page Reports
Question: “I have a Footer that I do not want to print on the first page of my report, unless the report is only one page.”
Solution:
Both the Headerband and FooterBand have boolean properties called PrintOnFirstPage and PrintOnLastPage that can be used to control whether the respective bands print.
Example:
- Set default behavior prior to calling Report.Print
123ppFooterband1.PrintOnFirstPage := False;ppReport1.PassSetting := psTwoPass;ppReport1.Print;
- Add the following code the Report.OnEndFirstPass event:
12345678procedure TForm1.ppReport1EndFirstPass(Sender: TObject);begin{override default behavior for a single page report}if ppReport1.AbsolutePageCount = 1 thenppFooterband1.PrintOnFirstPage := True;end;