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

How to determine height of dynamic-height summary region?

edited November 2003 in RAP
Hi,
In Rap, how can I determine the height of a dynamic-height summary region
which contains a Memo that is set to stretch? I want to do this in order to
move it to the bottom of the last page of an invoice (which also is also
using the footer for all pages).

The contents of the memo is known at the start of the report, and does not
change during the course of the report. I am positioning the footer with:
Summary.PrintPosition := Report.PrinterSetup.PaperHeight -
Report.PrinterSetup.MarginBottom - Summary.Height - Footer.Height;
and tried at various points (eg StartSecondPass) however it appears the
Summary.Height is never updated.
Hopefully this can be achieved without changing RAP, as the invoice is
generated in a generic module which I'd rather not change!

Mike H.
(RBv7.02)

Comments

  • edited November 2003

    Open RBuilder\Source\ppCtrls.pas and search for the
    TppCustomMemo.CalcSpaceUsed method.

    This method calls TppPlainText.WordWrap to wrap the text. The space used by
    the memo is calculated as the number of wrapped lines * line height.

    Like most calculations in RB, the SpaceUsed is calculated in thousandths of
    an inch. You can use the ppFromMMThousandths conversion function to convert
    to other units. This function is in ppUtils.pas. Search the RB source code
    for example calls.




    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.