0
votes

I have a multi-parameter report in SSRS where I want to display or hide a report depending on the parameter selection. If the user selects only one facility from a multi-value facility parameter then I want a second report to display along with the main report(it would be a separate tab). If multiple facilities are chosen then I only want the main report to display.

I've been playing with the visibility expressions on the second report but I can't seem to get it to work.

I've tried:

   =IFF(Parameters!entity.IsMultiValue, "True", "False")

but that returns an error "The hidden expression used in tablix returned a data type that is not valid.

I've also tried:

   =IIF(Parameters!entity.Count = 1), "False", "True")

But I get the same error. I'm using SSRS 2016.

2
first one, you are missing the comparison condition? second one, you are missing (?LONG
The second one is just a typo when I typed it on here. How is the first one missing a comparison condition? It's based on whether the report is hidden or not. Isn't it saying, "If the selection for the entity parameter is multivalue, then True(Hidden), else False(not Hidden)?jackstraw22

2 Answers

1
votes

False and True are not strings but constants.

Change it to:

=IIF(Parameters!entity.IsMultiValue="Your value", True, False)

And the second one to:

 =IIF(Parameters!entity.Count = 1, False, True)

Good luck.

1
votes

True and False are not strings, they are booleans. The Visibility property looks for a boolean, but in the expressions you gave (assuming your syntax was correct when testing it), you are passing strings since you have them enclosed in double quotes. Remove the double quotes and that will clear that error.

You also don't need to use IIf here -- you can simply use the first argument of the IIf, since that by itself will evaluate to True or False. I doubt there is any appreciable performance difference, but just a small thing to note.