Hide text conditionaly

Stimulsoft Reports.NET discussion
Post Reply
Claudio Maccari
Posts: 12
Joined: Fri Jun 09, 2006 11:53 am
Location: Italy

Hide text conditionaly

Post by Claudio Maccari »

How can I hide/show a StiText on the report ?
The control does not have a Visible property

Many thank
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Hide text conditionaly

Post by EDV Gradl »

Text.Enabled = true / false ??
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hide text conditionaly

Post by Edward »

You can do it in the BeforePrintEvent of the DataBand or any other band on which the StiText component is placed.

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Hide text conditionaly

Post by Vital »

For also you can use property Conditions of this text component.

Thank you.
nelson chai
Posts: 16
Joined: Mon Jan 08, 2007 4:01 am

Hide text conditionaly

Post by nelson chai »

Hi,

I can Hide StiText Using BeforePrintEvent but StiText = "" it can't work. Only StiText = " " it's work. (got a space inside)

Another things is StiText is in Databand. I set Databand to AutoShrink. The StiText i want to hide is in the last row.
But it can't Auto Shrink.

I think the problem is at StiText cause it's value " ".

In this case, how to solve this kind of problem?

Thanks.

Regards,
Nelson Chai
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hide text conditionaly

Post by Edward »

nelson wrote:Another things is StiText is in Databand. I set Databand to AutoShrink. The StiText i want to hide is in the last row.
But it can't Auto Shrink.

I think the problem is at StiText cause it's value " ".

In this case, how to solve this kind of problem?
Yes, it is true.
If Text1.TextValue contains " " value then such component will not be shrunken to zero height.
You can set Text property of the text component in the following way:

Code: Select all

{Line==Categories.Count?String.Empty:Categories.CategoryID.ToString()} 
In that case text component from the last row printed will contain an empty string inside. If you set CanShrink property of the DataBand and of the Text component on it in true then the last row will disappear.

Thank you.
nelson chai
Posts: 16
Joined: Mon Jan 08, 2007 4:01 am

Hide text conditionaly

Post by nelson chai »

Hi,

I'm using VB.Net.

If Fields Label is stiText, How do i hide it?

For eg, Name : Steven Tan -> Format (Label : FieldValue)

How to hide label "Name" when FieldValue is empty?

Thanks a lot.

Regards,
Nelson Chai
nelson chai
Posts: 16
Joined: Mon Jan 08, 2007 4:01 am

Hide text conditionaly

Post by nelson chai »

Hi,

Thanks for your previous advice.

Another question...
I'm using VB.Net.

If Fields Label is stiText, How do i hide it?

For eg, Name : Steven Tan -> Format (Label : FieldValue)

How to hide label "Name" when FieldValue is empty?

Thanks a lot.

Regards,
Nelson Chai
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Hide text conditionaly

Post by Vital »

For example:

Code: Select all

{IIF(FieldValue.Length = 0, "", FieldValue.ToString()}
Thank you.
Post Reply