Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Dynamically change the cell background and font color

I need to change the Table Cell Background color to Yellow and Font color to Bold / Red for values which are less than 80.

Cell Expression is =Fields!Mark.Value

How to change the Cell Background Color / Fill the Color to Yellow ?

like image 652
goofyui Avatar asked May 01 '14 01:05

goofyui


1 Answers

Nearly everything in SSRS is an expression, so you can use VBA code to conditionally set the property value.

To set the background colour, set the BackgroundColor property of the table cell to be:

=IIF(Fields!Mark.Value < 80, "Yellow", "White")

To set the font to bold, set the Font-FontWeight property of the table cell to be:

=IIF(Fields!Mark.Value < 80, "Bold", "Normal")

To make the text red, set the Color property of the table cell to be:

=IIF(Fields!Mark.Value < 80, "Red", "Black")
like image 96
Chris Latta Avatar answered Sep 22 '22 09:09

Chris Latta