Report Body dynamic resize

  1. 3 months ago

    Carl F

    Dec 29 Pre-Release Testers, Xojo Pro Webster, NY USA

    Is there way to resize the Body aspect of a Report?

    Basically I have a ReportField that contains a comma separated value. I am using CountFields on the String and then multiple the Body Height. I would set the Body Height to a default value in the BeforePrinting event each time then multiple that value by the CountFields value.

    This would allow for dynamic height in a field each time Report repeated and enable a better looking report.

    Any thoughts on if this can be accomplished?

    Hi Carl,

    Some time back I demo'd how to do this. You can download the demo project from here . The trick is where you set the height of the body.

    Cheers
    Wayne

  2. Wayne G

    Dec 30 Pre-Release Testers, Xojo Pro, MVP Answer Auckland, New Zealand

    Hi Carl,

    Some time back I demo'd how to do this. You can download the demo project from here . The trick is where you set the height of the body.

    Cheers
    Wayne

  3. Carl F

    Dec 30 Pre-Release Testers, Xojo Pro Webster, NY USA

    @Wayne Golding - that is awesome. I am always relying on Auto Complete to test mnemonic structures and Body would never start to show itself.

    This opens some new formatting capabilities in Reports

    Thank you and Happy New Year

  4. Wayne G

    Jan 2 Pre-Release Testers, Xojo Pro, MVP Auckland, New Zealand

    Hi Carl,

    In the real world I use Graphics.TextHeight to calculate the height of the row, how do you calculate the height? The demo was a bit less that useful in that area.

    And I hope you also had a Happy New Year.

  5. Carl F

    Jan 3 Pre-Release Testers, Xojo Pro Webster, NY USA
    Edited 3 months ago

    @Wayne G - so far so good - thanks

    For text height I simply defaulted to using the ReportField height. I have never been able to find an absolute way to determine font height with relation to its unit and font impact (BOLD, Italic etc).

    To accomplish you would need to consider TextUnit, TextSize, TextFont(now FontName). Then you would need to be able to convert that into a meaningful unit of measure to adjust that ReportField height. Right now it is a fudge factor settled on with experimenting.

    Coming up with a method that would associate TextUnit, TextSize, FontName and enable dynamic ReportField or any Text Field height would be best. I have looked and have not found anyone who has solved it and I just simply moved on to other coding needs and never attempted to resolve myself beyond making a setting, running code, repeat until the appearance was acceptable.

  6. last week

    Attila N

    Mar 26 Pre-Release Testers, Xojo Pro

    Wow! And thank you!
    But how you figured out this secret? And there is more usable trick?

    Regards,
    Attila

or Sign Up to reply!