Home Subreports

First page / follow pages

edited March 2003 in Subreports
Hello,

I have the following problem:

a report with a subreport which contains two more subreports.

I want the header-band and the footer.band of the main-report to be
printed only on the first page. (by using "print on first page") This
works fine, as long as the report produces more than one page. If
there is only one page, the header and footer band are not visible.

Do you have any suggestions? I would appriciate any help! Thanks you

Uwe Pätzold -softelligence KG -

Comments

  • edited March 2003
    -------------------------------------------------------
    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,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    "Jim Bennett \(Digital Metaphors\)"
    schrieb:



    Thank you Jim for your quick reply,

    as i'm not a programmer, i find the described way quite complicated. I
    would assume tha "print on first page" should do exactly this -
    printing the band on the first page -

    Well - so my programmers have to do the job - (i think it was Henry
    Ford who "invented" the division of labour :-)

    By the way: are you going to implement a undo function? Beside that,
    congratulation on a great product!

    Uwe Pätzold - Hamburg - Germany (and still a friend of the american
    people and country)
  • edited March 2003
    Thank you for the kind words. The undo function is on the ToDo list.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.