GetActualSize is returning 0 height and width

Stimulsoft Reports.Silverlight discussion
Locked
shyam.pundkar
Posts: 56
Joined: Fri Feb 21, 2014 9:26 am

GetActualSize is returning 0 height and width

Post by shyam.pundkar »

Dear Stimulsoft Team

I am trying to get the actual size of stiText. I initialized the instance of stiText with the height and width of 0.8 and assigned a large text to TextValue then I executed below lines. But still I am getting 0 as width and height.

((StiText)cellComponent).CanGrow = true;
((StiText)cellComponent).CanShrink = true;
((StiText)cellComponent).AutoWidth = true;

var actualSize = ((StiText) cellComponent).GetActualSize();

Could you please help me in getting the actual size of stiText?

Thanks
SHYAM
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: GetActualSize is returning 0 height and width

Post by HighAley »

Hello.

Why do you need to get height of the text component?
Do you use pure Silverlight or Client/Server version?
Could you send us any sample report?

Thank you.
shyam.pundkar
Posts: 56
Joined: Fri Feb 21, 2014 9:26 am

Re: GetActualSize is returning 0 height and width

Post by shyam.pundkar »

Dear Aleksey

I got the solution of my problem.
I am using client/server version.
The very first cell in a row of the report was getting wrapped because of the large text content. I wanted the other cells in the same row to follow the same height as the very first cell's height.
So I wanted to get the height of the first cell so that I can apply that to subsequent cells.
I got the actual height of the first cell by first calling Render and then calling GetActualSize. I wrote this piece of code at server side.

((StiText) cellComponent).Render().GetActualSize();

Thanks for acknowledging my question!

Best Regards
SHYAM
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: GetActualSize is returning 0 height and width

Post by HighAley »

Hello.

Why don't you set the Grow to Height property.
Please, read the Binding The Bottom Border Of A Component article.

Thank you.
shyam.pundkar
Posts: 56
Joined: Fri Feb 21, 2014 9:26 am

Re: GetActualSize is returning 0 height and width

Post by shyam.pundkar »

Dear Aleksey,

I replaced my code with the GrowToHeight = true and it worked!
So now I am using GrowToHeight property.

Thanks for your solution and the informative link.
Really Appreciated!

Best Regards
SHYAM
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: GetActualSize is returning 0 height and width

Post by HighAley »

Hello.

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

Thank you.
Locked