Height adjustment TextComponent after rendering

Stimulsoft Reports.NET discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Height adjustment TextComponent after rendering

Post 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
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Height adjustment TextComponent after rendering

Post 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.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Height adjustment TextComponent after rendering

Post by tpontow »

Hello HighAley,

thanks for the quick response and your hint to the

Code: Select all

StiText.GetActualSize()
method. That helped me to solve my problem! Great!

Thank you and kind regards
Thorsten
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Height adjustment TextComponent after rendering

Post by HighAley »

Dear, Thorsten.

We are always glad to help you.
Let us know if you need our help.

Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: Height adjustment TextComponent after rendering

Post by dmasterplan »

Hi,

Code: Select all

GetActualSize().Height
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 :)
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Height adjustment TextComponent after rendering

Post by Lech Kulikowski »

Hello,

You can check that with the following code:
(report.RenderedPages.GetComponentByName("Text1") as StiText).Height;

Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: Height adjustment TextComponent after rendering

Post by dmasterplan »

Hi,

Thanks for replying!
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Height adjustment TextComponent after rendering

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply