I have to hide a column in a report depending on a parameter. The Parameter (@vExclude) is a text type. It has the following available Options: the Label "None" with Value 0 or Label "Type1" with Value 1 or Label "Type2" with Label 2, it's possible to select multiple values, the default is 0.
The Column (SumCalc) i wanna hide is type money in SQL.
basically the logic is if @vExclude != "none", then show SumCalc in Report. I've tried the following expressions:
=iif(Parameters!vExclude.Label is ("none"), true, false)
=iif(Parameters!vExclude.Value is ("0"), true, false)
=iif(Parameters!vExclude.Value is ("0"), false, true)
=iif(InStr(Join(Parameters!vExclude.Label,","),"none")=0,true,false)
they all work without error, but do not hide the column correctly. Either SumCalc is always shown or never, but my condition never works.
Following expressions provided an error message:
=iif(Parameters!vExclude.Label = ("none"), true, false)
=iif(Parameters!vExclude.Label = "none", true, false)
=iif(Parameters!vExclude.Value = 0, true, false)
=iif(Parameters!vExclude.Value is 0, true, false)
=iif(Parameters!vExclude.Value = "0", true, false)
=iif(Parameters!vExclude.Value = ("0"), true, false)
=iif(Parameters!vExclude.Value = (0), true, false)
=iif(Parameters!vExclude.Value is (0), true, false)
Does anyone has an idea what I am doing wrong in my expression?
The following should work. Note that we have used the Value as we are checking for umbers here.
=Join(Parameters!vExclude.Value,",").Contains(0)=False
This basically reads "If vExclude does not contain 0" which will return True
of it does not contain zero or False
if it does contain 0. No need to use an IIF()
, just use this as the expression for the Hidden
property.