Page 1 of 1
Height adjustment TextComponent after rendering
Posted: Mon Oct 10, 2016 6:47 am
by tpontow
Hello,
i need to make some adjustments to my Report after Rendering. So i have my own subclass derived from StiReport and i registered an event handler for the EndRender Event of my compiled Report.
Code: Select all
Compile();
CompiledReport.EndRender += CompiledReportEndRender;
In the handler code i reduce the font size of some text components. That all works fine.
Unfortunately the height of the text component is still the same after changing the font size. Is it somehow possible the shrink the height of the text component accordingly to the font size Change AFTER! rendering?
Thanks and Kind regards
Thorsten Pontow
Re: Height adjustment TextComponent after rendering
Posted: Tue Oct 11, 2016 8:10 am
by HighAley
Hello, Thorsten.
It's possible to get the right size of the component with the GetActualSize method.
You could call it and change the height of the component.
Thank you.
Re: Height adjustment TextComponent after rendering
Posted: Tue Oct 11, 2016 8:44 am
by tpontow
Hello HighAley,
thanks for the quick response and your hint to the
method. That helped me to solve my problem! Great!
Thank you and kind regards
Thorsten
Re: Height adjustment TextComponent after rendering
Posted: Tue Oct 11, 2016 11:52 am
by HighAley
Dear, Thorsten.
We are always glad to help you.
Let us know if you need our help.
Thank you.
Re: Height adjustment TextComponent after rendering
Posted: Fri Jul 22, 2022 2:59 am
by dmasterplan
Hi,
doesn't work for me as I don't want to get the Actual Size of the component.
I want to get the size (height) after it is rendered (grown - to fit its content).
I want to get the size of the text component after it is rendered.
For instance, my text height is 0.42, it will grow to fit the content of the component.
After growing (height), it's height won't be 0.42 now.
How can I get its size (height) as I will be assigning it to another text component
Great Thanks

Re: Height adjustment TextComponent after rendering
Posted: Mon Jul 25, 2022 11:37 am
by Lech Kulikowski
Hello,
You can check that with the following code:
(report.RenderedPages.GetComponentByName("Text1") as StiText).Height;
Thank you.
Re: Height adjustment TextComponent after rendering
Posted: Thu Jul 28, 2022 12:07 pm
by dmasterplan
Hi,
Thanks for replying!
Re: Height adjustment TextComponent after rendering
Posted: Fri Jul 29, 2022 11:52 am
by Lech Kulikowski
Hello,
You are welcome.