Page 1 of 1

Brush Color is incorrect for CrossTab

Posted: Wed Feb 17, 2021 1:40 pm
by salexn
Hello Team!
need to specify the color of the total column using this rule
Green: 100% - 71%
Yellow: 41% - 70%
Red: 0% - 40%
Grey: N/A

I use the following code to achieve this (ProcessCell event):

decimal val = 0.0M;
if (e.Row > 1) {
if (Decimal.TryParse(OverallScore.DataTable.Rows[e.Row - 2][1].ToString(), out val)){
e.Text = String.Format("{0:P2}", val);
if (val == -1.0M) {
e.Text = "N/A";
((StiText)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.LightGray);
} else
if (val >= 0.0M && val < 0.4M) {
((StiText)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
} else
if (val >= 0.4M && val < 0.7M) {
((StiText)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Orange);
} else
if (val >= 0.7M) {
((StiText)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Green);
}
}
}

But for some reason the result is incorrect
The attachment Incorrect Color.png is no longer available
I have attached the example

Moreover, when I preview it in Cloud it doesn't show the colors at all
The attachment No Colors.png is no longer available
Can you check what is wrong?

Re: Brush Color is incorrect for CrossTab

Posted: Fri Feb 19, 2021 7:42 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

> Moreover, when I preview it in Cloud it doesn't show the colors at all

On the Cloud, events are not supported.

Thank you.