Hide fields

Stimulsoft Reports.NET discussion
Post Reply
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

Hide fields

Post by Chan Kuan Leang »

Hi,

Can I know how do hide fields if there is no data?

For example, I have 2 fields side by side. One is DiscountLabel, another is DiscountAmount.

So can i hide both fields if DiscountAmount is $0 or null?

Can someone teach me that?

Thank you.
Smile
Chan Kuan Leang
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Hide fields

Post by Stéphane »

I think there is two ways to do this :

- you can set the Enabled properties of your two text components in the BeforePrintEvent of the DataBand
- or, you can use the property Conditions of the text component
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

Hide fields

Post by Chan Kuan Leang »

kakone wrote:I think there is two ways to do this :

- you can set the Enabled properties of your two text components in the BeforePrintEvent of the DataBand
- or, you can use the property Conditions of the text component
I am very new to this StimulReport. Is there any example you can show it. So sorry to trouble you.
Smile
Chan Kuan Leang
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Hide fields

Post by Stéphane »

Look at the Highlight Condition report in the Demo program (Basic reports).

Look at the Text1 component in the dataBand, and instead of setting the color in red (into the Conditions property), you can uncheck the visible property.
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Hide fields

Post by Stéphane »

For your DiscountAmount field, you can also set the HideZeros property of the StiText component to true.
Chan Kuan Leang
Posts: 74
Joined: Sun May 20, 2007 9:14 pm
Location: Singapore

Hide fields

Post by Chan Kuan Leang »

kakone wrote:For your DiscountAmount field, you can also set the HideZeros property of the StiText component to true.
Thank you so much. Helps me to solve this problem.

Thank you!!
Smile
Chan Kuan Leang
Post Reply