SSRS change text colour.

aneilg
aneilg used Ask the Experts™
on
i want to change the colour of my text.
my textbox expression is '' so if there is no value set it to report not run.
but i also want to chaneg the colour to red.
=Iif(IsNothing(Fields!WhenRun.Value),"Report Not Run",Fields!WhenRun.Value)

so in my colour expression i have
=Iif(Fields!Max_Date.Value = "Report Not Run","Red","DimGray")

but all values are dimgray.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
SQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
I believe you'll need to do the same IsNothing expression for color ...

=Iif(IsNothing(Fields!WhenRun.Value), "Red","DimGray")
What is Fields!Max_Date.Value?   Is this a datetime or string?   If it is a date, then condition will always be false since it cannot be equal to "Report Not Run" which is of string data type.  Therefore, it will always apply "DimGray" in your case.
Hello aneilg,
Can you try following-
Select the field for which you wish to change text color, from the Property window set following expression for  Value and Color of the field.

In the Value section expression goes like this -
=IIF(Fields!FieldName.Value = "", "Report Not Run", Fields!FieldName.Value)

In the Color section expression is this -
=IIF(Fields!FieldName.Value = "", "RED", "DIMGRAY")

Thanks.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Author

Commented:
thanks for you help guys.

jimhorn got it.

Author

Commented:
thanks.
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Thanks for the grade.  Good luck with your project.  -Jim

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial