rbWiki > Delphi Code > Layouts > PrintOnFirstPage for One Page Reports

PrintOnFirstPage for One Page Reports

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:

  1. Set default behavior prior to calling Report.Print
  2.  

    ppFooterband1.PrintOnFirstPage := False;
    ppReport1.PassSetting := psTwoPass;
    ppReport1.Print; 

     

  3. Add the following code the Report.OnEndFirstPass event: 
  4.  procedure TForm1.ppReport1EndFirstPass(Sender: TObject);
    begin
    
      {override default behavior for a single page report}
      if ppReport1.AbsolutePageCount = 1 then
        ppFooterband1.PrintOnFirstPage := True;
    
    end;

       

Tags
none

Files (0)

 
You must login to post a comment.