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
I have attached the example
Moreover, when I preview it in Cloud it doesn't show the colors at all
Can you check what is wrong?
Brush Color is incorrect for CrossTab
Brush Color is incorrect for CrossTab
- Attachments
-
- Incorrect Color.png (14.93 KiB) Viewed 595 times
-
- Posts: 6344
- Joined: Tue Mar 20, 2018 5:34 am
Re: Brush Color is incorrect for CrossTab
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.
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.