I have a tablix table with hundreds of rows of data. I would like to have the background color to be yellow right after a particular condition. How can I do that?
Example - I want all the data to be yellow iif(Fields!pet.Value="cat"), so hamster and on...
You need to change the expression for the cell's
BackgroundColor
and remember what it was. We'll need custom code for this. Go to theReport
menu, chooseReport Properties...
and click onCode
and enter the following code:Then in your cell make the
BackgroundColor
expression be:or for even more flexibility in copying the formula, use the built-in
Me
reference for the textbox:So what we are doing is creating a global variable for the pet color
ThisPetColor
and initialising that to "White". When the type of pet changes, if it is one of the ones where we change color then we change the value of the global variable to be the new pet color and use that thereafter (until the next pet type).