简体   繁体   中英

Hide or show SSRS component based on multivalue parameter

I have an SSRS report that is based on a parameter that can have multiple values. For example: '0','1' and '0','2' (like an IN statement).

Now, I have to show certain parts in the the report whenever the parameter is 0 AND 1, and hide certain parts in the report whenever the parameter is 0 AND 2.

But… This 0 value is always the issue here. I know I have to use the visibility expression for this, but I cannot seem to write the correct expression.

So, when my parameter (Parametername = Prognosis) is (0 and 1) , I need the component to show. When my parameter is (0 and 2) , I need the component to hide. By the way, it is never just '0', or just '1', or just '2'.

I tried this, but no success:

=IIF(Parameters!Prognosis.Value(0) = 0 and Parameters!Prognosis.Value(0) = 1,False,IIF(Parameters!Prognosis.Value(0) = 0 and Parameters!Prognosis.Value(0) = 2,True,False))

Could someone help me with writing this expression?

Thank you guys

Use join() to put the values of the parameter into a string. So it would be..

=join(Parameters!Thingy.Value, ",")

Then you can see what values are returned by the string. eg

=iif(join(Parameters!Thingy.Value, ",") = "0,1", TRUE, FALSE)

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