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

Last detail on a page

edited April 2002 in General
Hello ,

I am trying to print a line at the bottom of the detail band, but only if
this detail is the last of a page.
i am using the visible property of the line, but how to know if the detail
band that is printing is the last of the page.

D6 + RB 6.03

Thank you.

Comments

  • edited April 2002
    Here is a Delphi example project which you can download:

    http://www.digital-metaphors.com/tips/LastLine.zip

    This is the code which will set a line to be visible at the bottom of the
    last detail on the page:

    procedure TForm1.ppReport1DetailBand1BeforeGenerate(Sender: TObject);
    var
    llSpaceAvailable: Longint;
    lDetailBand: TppDetailBand;
    begin

    lDetailBand := TppDetailBand(ppReport1.GetBand(btDetail, 0));

    llSpaceAvailable := ppReport1.Engine.PageBottom -
    lDetailBand.PrintPosRect.Bottom;

    ppReport1Line1.Visible := (llSpaceAvailable < lDetailBand.mmHeight);

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited April 2002
    Thats why i love RB. There's always an ellegant solution to almost all the
    requirements. Don't get tired of say it: great tool and wonderful design.
    bye

  • edited April 2002
    Thank you, it works fine,
    but, is it possible to put it on the calc tab of report builder (event
    BeforeGenerate of detail band) ?
    In this case, I have a problem with the GetBand(...) function and the uses
    ppTypes.

    Daniel Herbepin
    AIGA

  • edited April 2002
    In RAP, try just referencing the detail band object directly, instead of
    trying to pull it from the report object as shown in the demo.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.