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

RAP- How to detect the detail band is the last band to be printed

edited June 2004 in RAP
Hi,

How to check if the report detail band is the last band or not.


Thanks

William

Comments

  • edited June 2004

    You do not know whether the band is the last one on the page until the page
    is completed. You could perhaps use the DetailBand.AfterPrint to store
    information about the latest detail band that has printed on the page and
    then in the Report.OnEndPage event you would know that the band is the last
    on the page.

    Here is a Delphi code example of drawing a line after the last detail band
    on each page...

    www.digital-metaphors.com/tips/LasDetailLine.zip


    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2004
    Hi, Nard

    Thanks for the answer, but is it possible to know if the page is the last
    page or not?

    Best Regards,

    William

  • edited June 2004

    It is not known whether a given Page is the last page until after the report
    engine generates the page and sends it to the report's publisher (which in
    turn sends the page to the device).

    There is an Engine.AfterSendPage event. I tried the following and that
    seemed to work:


    procedure TForm1.FormCreate(Sender: TObject);
    begin
    ppReport1.Engine.AfterSendPage := ehAfterSendPage;
    end;

    procedure TForm1.ehAfterSendPage(Sender: TObject);
    begin
    if ppReport1.Engine.Page.LastPage then
    messagebeep(0);

    end;



    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2004
    Hi, Nard

    Thanks a lot.

    William

This discussion has been closed.