Textbox hidden expression for multiselect parameter
Hi All,
In my ssrs 2008 R2 report (at the end) I am putting two textbox, lets say A and B. Now my report parameter, lets say @param , is a multiselect values , which I am hardcoding as, lets say Value1, Value2 i.e. @param has only 2 values and is a multiselect
parameter.
Now, the textboxes A and B should be appearing in the report, based on the HIDDEN EXPRESSION I am writing for that parameter's values i.e. Value1 and Value2 , which I am writing as below:-
=IIF(Parameters!param(0) =
"Value1",
False,
True) -- this is for textbox A
=IIF(Parameters!param(0) = "Value2",
False,
True) -- this is for textbox B
--Everything works fine till here. If I select Value1 of that parameter then textboxA is only appearing which is correct; if I select value2 then only textboxB is appearing which
is also correct. But now, if I select both of them together i.e. Value1,Value2 then those both textboxes A and B are not appearing. Only first one appears. I want it such a way that if I select both values from multiselect then both textboxes A,B should be
appearing.
why is that so.? I know I have to modify the hidden expression of textboxes.Any idea ?
June 17th, 2011 12:01pm
Try this -
=IIF(Join(Parameters!param.Value,",") = "Value1,Value2"FALSE, TRUE)
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2011 12:28pm
Just to tweak Shahfaisal's statement, you'll want it to show if Value1 is found anywhere in the Parameter list, so you can use Like to see if it is any one of the items selected. Use * as wildcard.
=Iif(Join(Parameters!param.Value,
", ")
LIKE
"*Value1*",FALSE,
TRUE)Martina White
June 17th, 2011 2:21pm
Hi All,
Thanks for the lovely suggetions. I am using now below exp. to get values of Value1, Value2 if they are selected at all in the parameter list.
--for textbox A
=IIF(Join(Parameters!param.Value,
",") =
"Value1,Value2",
False, IIF(Parameters!param.Value(0) =
"Value1",
False,
True))
--for textbox B
=IIF(Join(Parameters!param.Value,
",") =
"Value1,Value2",
False, IIF(Parameters!param.Value(0) =
"Value2",
False,
True
))
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2011 2:44pm
Hi UltraDev,
This expression works perfect:-
= IIf ( JOIN ( Parameters!Param.Value, "," ) = "Value1,Value2", FALSE, IIf ( Parameters!Param.Value(0) = "Value1", FALSE, TRUE ) )
= IIf ( JOIN ( Parameters!Param.Value, "," ) = "Value1,Value2", FALSE, IIf ( Parameters!Param.Value(0) = "Value2", FALSE, TRUE ) )
Please let us know your feedback when you get a chance.
Thanks
KumarKG, MCTS
June 17th, 2011 4:13pm