Daniel Trocker
asked on
SSRS: show empty field if the logical test is false
Hi,
I am using the "iif"-function in SSRS. How is it possible to show nothing, if the logical test is wrong?
I.e.
IIf(Parameters!totaldager. Value=0,Pa rameters!F VDager.Val ue,"")
I am getting the right values if the logical test is true, but I am just getting #Error - messages if it is false.
Any suggestions are much appreciated.
Thanks
Daniel
I am using the "iif"-function in SSRS. How is it possible to show nothing, if the logical test is wrong?
I.e.
IIf(Parameters!totaldager.
I am getting the right values if the logical test is true, but I am just getting #Error - messages if it is false.
Any suggestions are much appreciated.
Thanks
Daniel
ASKER
Hi Russell,
I am still getting the #Error-message when taking your formula. Isn't there a possibility to format the fields with "#Error", such that they are transparent or white?
Thank's in advance.
Daniel
I am still getting the #Error-message when taking your formula. Isn't there a possibility to format the fields with "#Error", such that they are transparent or white?
Thank's in advance.
Daniel
My guess is a type mismatch. Is "Parameters!FVDager.Value" supposed to be a numeric value? If so, you will want to convert that expression to a character string so that both possible output values are of the same type, in this case a string value.
I agree with @larryh, above. You're saying "if this is the number zero, input the string <empty string>.
IIf(Parameters!totaldager.Value=0,Parameters!FVDager.Value,"")
You might be better off sticking with numeric values:IIf(Parameters!totaldager.Value=0,Parameters!FVDager.Value,0)
And then, as you suggest, change the text color to a dynamic value, something likeIIf(TextBox123.Value=0, "White", "Black")
ASKER
Hi again,
thank you all for your comments. After playing around with the formulas I noticed the following:
1. All the formulas work, if I set them up like this (the decisive part is the "2" at the end.
=IIf(Fields!budsjett.Value =0,"",Fiel ds!Oms_ink l_samlefak .Value/2)
2. If I substitute the "2" with a "Field!Name.Value", SSRS gives an #Error-message and I am also not able to change color in the formatting in order to hide the #Error.
BR
Daniel
thank you all for your comments. After playing around with the formulas I noticed the following:
1. All the formulas work, if I set them up like this (the decisive part is the "2" at the end.
=IIf(Fields!budsjett.Value
2. If I substitute the "2" with a "Field!Name.Value", SSRS gives an #Error-message and I am also not able to change color in the formatting in order to hide the #Error.
BR
Daniel
ASKER
Supplement to my previous comment:
"IIf(Fields!budsjett.Value =0,"",Fiel ds!Oms_ink l_samlefak .Value/Fie lds!Budsje tt.Value)" does not work.
"IIf(Fields!budsjett.Value
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window