Page 1 of 1

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

Posted: Wed Apr 16, 2008 8:16 am
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

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

Posted: Thu Apr 17, 2008 12:52 am
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.

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

Posted: Thu Apr 17, 2008 2:58 am
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

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

Posted: Thu Apr 17, 2008 4:25 am
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.