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

Footers

edited April 2002 in General
When printing a page with a Footer set with the attributes PrintOnFirstPage
(off) and PrintOnLastPage (on) this works as expected with a 2-page report,
but if the report is only 1 page long, no footer is printed. A classic
example of this is an invoice where the total is to be printed on the final
page only. If the invoice fits on 1 page, then no total is printed!

Any solutions other than printing the footer on every page?

Peter Grimshaw

Comments

  • edited April 2002
    To print the total on the final page only use the summary band which will
    print at the very end of the report. Set the summary band's PrintPosition to
    align it with the bottom of the page. To get the report footer to not print
    on the first page in a one page report follow the guidelines below:

    -------------------------------------------------------
    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

    ppFooterband1.PrintOnFirstPage := False;
    ppReport1.Print;


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

    procedure TForm1.ppReport1EndFirstPass(Sender: TObject);
    begin

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

    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.