Reputation: 1897
I have an RS report with a basic table set up, I've set it up to hide specific columns if a custom specified value is selected. Parameter is set like so:
Label | Value
Select All | 1
Select 1 | 2
Select 2 | 3
Select 3 | 4
Then in the tablix column visibility its set to:
=Parameters!Client.Value <> 1
However I ideally want to set it to select more than one of the parameter values however I get:
The Hidden expression for the table 'tablix' contains an error: operator <> is not defined for the type Object() and type integer .
Any ideas?
Upvotes: 2
Views: 5449
Reputation: 39586
You need to set up Client as a multi-value parameter to allow more than one value to be selected.
The issue is that multi-value parameters are array based, so you can't treat them like you would single-value parameters. To get the values selected you need to use the Join
function, which returns a string of the selected values.
Once you have this list, you can check for certain values in the string returned and base the visibility of each column on whether its value has been selected. So for each column's visibility use something like:
=IIf(InStr(Join(Parameters!Client.Value, ","), "1") > 0, false, true)
i.e. if the value 1 is in the string of selected values, don't hide, otherwise hide.
I created a simple report to test this out. Some examples:
So this should suit your requirements.
Moving to a multi-value parameter also means you can remove the Select All option from the available values as this is always available by default.
Upvotes: 2
Reputation: 12375
you need to convert the Parameter value to Int in order to compare it.
do this :
= CInt(Parameters!Client.Value) <> 1
Upvotes: 0