Conditional Highlighting on Crosstab Summary Cells

Stimulsoft Reports.NET discussion
Post Reply
topsys
Posts: 8
Joined: Tue Sep 29, 2009 6:52 am

Conditional Highlighting on Crosstab Summary Cells

Post by topsys »

I have a crosstab report with 4 summary cells per row/column.
I need to change the text colour in the 4th summary cell to red if the cell value is less than 90.

I know that in a normal call I would use the following in the expression type for conditions
value <=90

I am guessing that I would need to use something like:
(e.Cell.SummaryIndex == 3) && value <=90
But I don't know the correct syntax here. could somebody guide me?


Also, in the cross tab cells (not the summary), is this possible to use the value of another field in a calculation eg:
e.Value = e.Value / Cells [-3, 0];

I get errors on above value...

However this works in the Summary Cell OK:
if (e.Cell.SummaryIndex == 3)
e.Value = e.Value/Cells [-3,0];

Many thanks in advance
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Conditional Highlighting on Crosstab Summary Cells

Post by Ivan »

Hello,
topsys wrote:I have a crosstab report with 4 summary cells per row/column.
I need to change the text colour in the 4th summary cell to red if the cell value is less than 90.
You can use the following script in the ProcessCell event of ColTotal, for example:

Code: Select all

if ((e.Cell.SummaryIndex == 3) && e.Value <= 90)
{
  e.Cell.Field.TextBrush = new StiSolidBrush(Color.Red);
}
Thank you.
topsys
Posts: 8
Joined: Tue Sep 29, 2009 6:52 am

Conditional Highlighting on Crosstab Summary Cells

Post by topsys »

Many Thanks Ivan!!

A note of others, I found that I had to remove the {} brackets for this to run in the ProcessCell Event

if ((e.Cell.SummaryIndex == 3) && e.Value <= 90)
e.Cell.Field.TextBrush = new StiSolidBrush(Color.Red);
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Conditional Highlighting on Crosstab Summary Cells

Post by Andrew »

Thank you for sharing your knowledge with other users.

Thank you.
Post Reply