简体   繁体   中英

SSRS tablix visibility

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM