Report Body dynamic resize

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.


@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

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.

@Wayne Golding - 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.

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