How to get the real size of the StiText in runtime?

Stimulsoft Reports.NET discussion
Post Reply
misurevigor
Posts: 1
Joined: Wed Dec 27, 2017 4:11 pm

How to get the real size of the StiText in runtime?

Post by misurevigor »

Hello.
How to get the real size of the StiText in runtime with the property turned on CanGrow?

public void txtLevel4_DoubleClick(object sender, System.EventArgs e)
{
System.Windows.Forms.MessageBox.Show(txtLevel4.Height.ToString());
}

When the report is running, regardless of whether there is more or less field on the screen, the Height property is always equal to one value ...
How to be?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to get the real size of the StiText in runtime?

Post by HighAley »

Hello, Igor.

You are getting the Height of the component from a report template page.
The components of the rendered report are on the rendered pages. And usually there are several instances of the same text component.
You could use GetValue event to get the component from the rendered page. But its height is calculated later. So you should use the AfterPrint event of its container.
Please, look at the attached report template.

Thank you.
Attachments
GetHeight.mrt
(4.57 KiB) Downloaded 327 times
Post Reply