SSRS Using the SWITCH Function To Change Font Color

16 Views Asked by At

I'm trying to use the SWITCH Function in SSRS to change the font color in a text box based on words in the text box.

My text box is called "Instructions". I want it so that if it finds the string "Bio" AND the string "setup" in the contents of the text box, it turns the font color green.

If it just finds the string "Bio" (but not setup) change the font color to Blue

If it just finds the string "setup" (but not Bio) change the font color to red

otherwise, the default color should be black

Right now the results are all in black font color.

=SWITCH( InStr(ReportItems!Instructions.Value, "Bio") AND InStr(ReportItems!Billing_Instructions.Value, "setup"), "Green", InStr(ReportItems!Instructions.Value, "Bio"), "Blue", InStr(ReportItems!Instructions.Value, "setup"), "Red", "Black" )

I'm not quite sure what I'm doing wrong and would appreciate any input. Thank you.

To change the font colors based on specific strings being found in the text of a text box.

0

There are 0 best solutions below