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

Header (print on first page !!!)

edited April 2003 in General
Hi,

I have set the property PrintOnFirstPage on true and the PrintOnLastpage on
false of my Headerband.
When i have a report with only 1 page i get NO header.
(this is because the page is the first page and also the last page so i get
no header)
When i have a report with more pages i get my header on the first page. ->
This works fine !

I need to have a header that prints always on the first page !!!! Also by 1
page !!

Greeetz Hans

Comments

  • edited April 2003
    Hans,

    The example code below shows how you can check if your report is only one
    page and adjust the band print setting accordingly.

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

    ppHeaderband1.PrintOnFirstPage := True;
    ppHeaderband1.PrintOnLastPage := False;

    ppReport1.Print;

    2. Add the following code in the Report.OnEndFirstPass event...

    procedure TForm1.ppReport1EndFirstPass(Sender: TObject);
    begin

    {override default behavior for a single page report}
    if ppReport1.AbsolutePageCount = 1 then
    ppHeaderband1.PrintOnLastPage := True;

    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.