How-To change Text.Brush depending on CountIF - Expression in same text component

Stimulsoft Reports.NET discussion
Post Reply
Markus Weiß

How-To change Text.Brush depending on CountIF - Expression in same text component

Post by Markus Weiß »

Hi,

i'm wondering how to change the Brush property of a text component depending on the calculated "value" of the text expression of the same text component.

My text-expression on component Text18 is defined as follows:

Code: Select all

{IIf(Count(DataBand1) > 0, CountIf(DataBand1, Person.UID_Department="") / Count(DataBand1), 0)}
My goal is to set

Code: Select all

Text18.Brush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red)
if the value of Text18 > 20 (for example). As an additional info - the Format of Text18 is set to % (corresponding to the example Text18 > 20,00%)

Any Ideas?

By the way - a documentation of the rendering process an the workings of the events (GetValue, BeforePrint,...) would be highly appreciated.

Thanks

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

How-To change Text.Brush depending on CountIF - Expression in same text component

Post by Edward »

In the prerelease build of April, 16 we've added a possibility of working with these functions in 'Conditions' property of the Text component.
So now you can analyze the result of the value which is present in the text component and depending on even change the rendered value.
Please see here how it works:

http://forum.stimulsoft.com/Default.aspx?g=posts&t=1172


Thank you.
Markus Weiß

How-To change Text.Brush depending on CountIF - Expression in same text component

Post by Markus Weiß »

To make it clear for me:

I'm setting

Code: Select all

Text18.Tag = {IIf(Count(DataBand1) > 0, CountIf(DataBand1, Person.UID_Department="") / Count(DataBand1), 0)}
and

Text18.Condition auf Expression and the Expression is

Code: Select all

tag > 20
Is this correct?

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

How-To change Text.Brush depending on CountIF - Expression in same text component

Post by Edward »

Yes, it will work since the next prerelease build. Now it works only in Cross-Tab, sorry.

But all functions which you use can be used now in the Conditions directly.

Thank you.
Post Reply