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

URGENT: Getting height of a dynamic group or band at runtime

edited March 2004 in General
Hi,

I am trying to get the height of a group which is kept together. I need
to re-order the table in order to print them at minimum number of
pages. For example;

G1: Height = 6/10 of page height
G2: Height = 7/10 of page height
G3: Height = 4/10 of page height

RB will print it to 3 pages. But if I rearrange records to order G1,
G3, G2, it will fit to 2 pages. I tried AfterPrint and AfterGenerate
events without success.

Any chance?

PS: Using RB7.02 & D6.
Sean

Comments

  • edited March 2004

    You can try using the Band.AfterGenerate event to check the Band.SpaceUsed
    property. The units are microns, therefore you might want to convert to
    inches or some other units. There are some routines defined in ppUtils.pas
    that enable conversion. Most common are ppFromMMThousandths and
    ppToMMThousandths.

    That being said, you cannot modify the dataset or affect pagination while
    the report is generating.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2004
    Greatly appreciated. I will try and let you know.

    Thanks
    Sean


  • edited March 2004
    Working like a charm.


    I do not need to rearrange on the fly. So no problem.

    Thanks

    Sean
This discussion has been closed.