Expression for Font Color

  • I need help with an expression for Font color.

    This is the current expression

    =IIF(SUM(Fields!Hours.Value) > Fields!Max_Hours.Value, "Red", IIF(SUM(Fields!Hours.Value) < Fields!Max_Hours.Value, "Green","Orange"))

    But sometimes the SUM(Fields!Hours.Value ) is NULL.

    I need to tweak the expression so that if its NULL then it treats it as zero and gives the color as Green.

    Currently its showing Orange.

  • Use ISNothing() - http://msdn.microsoft.com/en-us/library/dd283100.aspx

  • Yes , I am using Isnothing... But looks like at the wrong place 🙁

  • What result do you get with this?

    =IIF(SUM(Fields!Hours.Value) > Fields!Max_Hours.Value, "Red",

    IIF((SUM(Fields!Hours.Value) < Fields!Max_Hours.Value OR IsNothing(SUM(Fields!Hours.Value))), "Green" ,

    "Orange"))

    Alternately you could try this (older syntax):

    =IIF(SUM(Fields!Hours.Value) > Fields!Max_Hours.Value, "Red",

    IIF((SUM(Fields!Hours.Value) < Fields!Max_Hours.Value OR SUM(Fields!Hours.Value) IS NOTHING), "Green" ,

    "Orange"))

  • Will try this for sure

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply