Page 1 of 1

Conditional Highlighting on Crosstab Summary Cells

Posted: Mon Jul 11, 2011 11:27 am
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

Conditional Highlighting on Crosstab Summary Cells

Posted: Mon Jul 11, 2011 6:45 pm
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.

Conditional Highlighting on Crosstab Summary Cells

Posted: Tue Jul 12, 2011 1:38 am
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);

Conditional Highlighting on Crosstab Summary Cells

Posted: Tue Jul 12, 2011 6:11 am
by Andrew
Thank you for sharing your knowledge with other users.

Thank you.