Aleksey, this approach works well for regular text boxes in the report, but I am working with the text in a cell in a databound table.
For example, if I add a textbox to my report (Text1) I can create a Before Print event with the following code:
Code: Select all
Text1.TextBrush = new StiSolidBrush(Color.Red);
And when I view the report the text is red.
However, if I create a Before Print event handler for the text in a cell in the databound table, and put the same code as above, Text1 is
not red.
Long story short, we let the user define certain thresholds for which alerts need to be displayed (e.g., if output is less than 20% then flag as warning 1, if output is less than 40% then warning 2, etc.). We also let users specify the colors for various alerts, so the user could say they want to show warning 1 as red and warning 2 as orange, or whatever.
I have a table that shows the outputs for various pieces of machinery and in one column I want to show the alert (if any) with the appropriate color.
So imagine the user defines the alert levels as I described above and there exists the following data for the machines:
Machine1 - output=50%
Machine2 - output=34%
Machine3 - output=11%
What the report should look like is this:
Machine1 - output = 50% - NO ALERT
Machine2 - output = 34% -
Warning 2
Machine3 - output = 11% -
Warning 1
If another user defined the alert levels so that at output <= 50% is warning 1 and output <= 75% is warning 2 and warning 1 is purple and warning 2 is green, then their report would look like:
Machine1 - output = 50% -
Warning 2
Machine2 - output = 34% -
Warning 1
Machine3 - output = 11% -
Warning 1
Does that make sense? How can I do this with Stimulasoft?