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

How to Align The summary to the bottom?

edited March 2003 in General
Hi guys,

Is there a way (Preferably an easy one) to align the summary to the bottom
of a page in RAP?

I've downloaded and looked at the following:

- http://www.digital-metaphors.com/tips/AlignSummaryToBottom.zip
(but the RAP Compiler was not happy with Report.Summary.PrintPosRect.Top,
Report.Engine.PageBottom, ...)

- http://www.digital-metaphors.com/tips/RAPDrawCommands.zip
(but the dpk's are for delphi 6 and i'm using 7)

Any Suggestions?
Olivier Peter

Comments

  • edited March 2003
    The RAPDrawCommands demo is what you need. You'll have to change the
    requires clause for Delphi 7. Change the requires for rbRCL76 to rbRCL77 and
    rbRAP76 to rbRAP77.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    It still doesn't work as i expect it to:

    I Tried some the following

    Create the following Event for every component you want to move down:
    procedure ComponentNameOnDrawCommandCreate(aDrawCommand: TObject);
    begin
    FDrawCommandList.Add(aDrawCommand);
    end;

    In the Afterprint event of the summary i do the following:
    procedure SummaryAfterPrint;
    liSummaryTop := PrintPosRectTop(Report);
    liNewSummaryTop := PrintableHeightInMicrons(Report) -
    BandHeightInMicrons(Report, Summary);
    for liIndex := 0 to FDrawCommandList.Count - 1 do begin
    lDrawCommand := TppDrawCommand(FDrawCommandList[liIndex]);
    lDrawCommand.Top := (lDrawCommand.Top - liSummaryTop) + liNewSummaryTop;
    end;
    end;

    In other words: move all the objects of the summary band down with a number
    of pixels.

    I found the this approach in
    http://www.digital-metaphors.com/tips/AlignSummaryToBottom.zip

    Am i forgetting something?



  • edited March 2003
    I ported the Delphi based example to work in RAP by adding some RAP pass
    through functions (included in this demo amongst others):

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


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Thanks for the effort Jim.

    However,

    When I open your project it says some things about some properties not
    available
    - ppReport1.ppOutlineSettings.Visible
    - ppReport1.TextSearchSettings.DefaultString
    - ppReport1.TextSearchSettings.Enabled

    When i open the report and have a look at SummaryAfterPrint it gives me
    Error on line 9: Undeclared Identitfier: 'BandPrintPosRectTop'

    Should the example work with version 7.00 or do i have to install 7.02?

    Olivier Peter


  • edited March 2003
    I used RB 7.02 to create the example. You can ignore the property errors. It
    is a runtime example. If you only have RB Standard installed and don't have
    the runtime designer component then you need to create and install a delphi
    design time package to support the new RAP functions at design time. This is
    easy, just include the two different RAP pass through function units from
    the demo inside a new package. In this example, there are two RAP pass
    through packages that can install into Delphi 6:
    http://www.digital-metaphors.com/tips/RAPDrawCommands.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.