Link to home
Start Free TrialLog in
Avatar of tanj1035
tanj1035

asked on

Color Fill expression SSRS

Hi Experts,

I want to add the expression for the textbox [MTDD1].
if [MTDD1] is nothing, shows  light grey;
if  [MTDD1] <[MTDS1], shows Red (in the attachment "preview", number 19 should show in red), otherwise shows CornflowerBlue.

I wrote the query, the SSRS can pass the expression, but the fill color did not apply. Can  anyone help me on it. Thanks.

=switch(Fields!Step.Value = "Total"   and Fields!MTDD1.Value<Fields!MTDS1.Value, "Red",  "CornflowerBlue",
 IsNothing(Fields!MTDD1.Value)
        ,"LightGrey"
    , True
        , Nothing
    )

User generated imageUser generated image
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Looks like your Switch parameters are not in the right order, they go like: condition 1, value 1, condition 2, value 2 and so on.

Try this:

=switch(Fields!Step.Value = "Total"   and IsNothing(Fields!MTDD1.Value)        ,"LightGrey"
    , Fields!Step.Value = "Total"   and Fields!MTDD1.Value < Fields!MTDS1.Value, "Red",
    , True        , "CornflowerBlue"
    )
Avatar of tanj1035
tanj1035

ASKER

Hi, Thanks for your reply.

I tried yours, but got the error message
"The BackgroundColor expression for the text box ‘MTDD1’ contains an error: [BC30588] Omitted argument cannot match a ParamArray parameter."

Actually, I am looking for the conditions like this
1)when Fields!Step.Value = "Total"   and Fields!MTDD1.Value<Fields!MTDS1.Value, IT HAS TO show "Red", otherwise "CornflowerBlue"
2)when [MTDD1] except Fields!Step.Value = "Total" is nothing, shows  light grey

I do not know if I express it clearly or not.  Looking forward to hearing from you.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial