Measure text

Stimulsoft Reports.NET discussion
Post Reply
ChristianH
Posts: 43
Joined: Fri May 25, 2007 2:54 am
Location: Austria

Measure text

Post by ChristianH »

Is it possible to measure text after rendering?
I have a StiText component where I hold some persons name plus degree:
e.g.

Franz
BINDER-REISINGER, Dr.

If the degree and/or name gets longer it cannot fit into the StiText component and there´s another linebreak:

Franz
BINDER-REISINGER, Dipl.-
Ing.

But I´d like to have follwing output:

Franz
BINDER-REISINGER,
Dipl.-Ing.

So I need to know length of lastname + ", " + degree to insert another "\n" after lastname if needed.
The StiText component should not grow in width, only in height.
In c# there´s a method called TextRenderer.MeasureText, does Stimulsoft Report offer similar method or is there another solution for my problem ?

:shame:
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Measure text

Post by Edward »

Hello, Christian.

Yes, it is possible in Stimulsoft Reports.Net as well.

In the 2008.1 or earlier versions please use the following static property:

StiReport.MeasureGraphics

in latest prerelease versions:

Stimulsoft.Report.StiReport.GlobalMeasureGraphics.MeasureString()


Thank you.
Post Reply