0
votes

I have developed SSRS Report. I am calling this report from C# code and passing filter parameters from there.I have to show the columns depending on one of the filer values received from code.Hence I am using below expression.

=IIF(Instr(JOIN(Parameters!Metrics.value,","),"5")>0,False,True)

But this is causing problem because report renders all values for Metrics 5,15,25,.... etc.Please suggest me solution so that it will take only that specific value.I tried using InstrRev as well but no luck.

Thanks in Advance !!

2

2 Answers

0
votes

Are you only expecting 1 value or many values for the filter?

If 1, then you can set the Filter Parameters!Metrics.Value = 5 or '5'

If many, set the Filter Parameters!Metrics.Value IN then put your join(parameters... in the expression.

This will set the filter to only show those rows in the dataset...

That is for FILTERS... if you mean you are trying to put this in the Visibility property, then I think it would be better to make a nested IIF or a Switch statement - then it will check 1:1..

ex. IIF([field value] =Split(Parameters!Metrics.Value," ").GetValue(0)
     OR [field value] =Split(Parameters!Metrics.Value," ").GetValue(1), False, True)

or Switch( [field value] =Split(Parameters!Metrics.Value," ").GetValue(0), False
           [field value] =Split(Parameters!Metrics.Value," ").GetValue(0), False, True)

I am assuming the field value is being compared against the Parameter value... or some comparison.. Make sure to Split on however you are sending it in...

0
votes

Try this:

=IIF(Instr("," & JOIN(Parameters!Metrics.value,",") & ",",",5,")>0,False,True)