0

What I want to do

I want to change rows background color if the column "NCRNumber"'s value is present in the multivalue parameter named listeRNC.

Here's the SSRS I am using right now :

= iif ((Parameters!listeRNC.Value.ToString() = Fields!NCRNumber.Value.ToString()), "Khaki","White")

What this does

This is only colouring the first row (which is also the first element in the Parameters!listeRNC)..

I know that I can access various item in the MultiValue list like this

Parameters!listeRNC.Value(index)

But how can I do a lookup in this list ? Just like with List.Find Method or with a foreach ?

TinkeringMatt
  • 181
  • 1
  • 9

2 Answers2

1

I think what you are looking for is a lot like the answer in the below link. But here is what would send you in a good direction:

=Iif(Array.IndexOf(Parameters!p_myMultipleValueParameter.Value, Fields!groepType.Value) > -1,"Found","Not Found")

IndexOf

Jesse
  • 865
  • 10
  • 18
0

Finally my problem wasn't so about the code itself, I had misconfigured the parameter itself. I used to add parameters manually through the XML code of the report. But the way I wrote the multivalue parameter was wrong.

So here's the proper XML for those who are interested :

<ReportParameter Name="YourParameterNameGoesHere">
  <DataType>String</DataType>
  <Prompt>ReportParameter1</Prompt>
  <MultiValue>true</MultiValue>
</ReportParameter>

And here's how I got to find this out : while viewer your report [design] mode, go to the toolstrip menu of visual studio -> view -> report data (ctrl+alt+D). Then go to Parameters, and right click -> add parameters. Make sure you check the Multivalue option. And there you go !

Here's the final code I used to parse the whole thing :

= iif((InStr(Join(Parameters!listeRNC.Value,",").ToString(),fields!NCRNumber.Value.ToString(),CompareMethod.Text)), "Khaki","White")
TinkeringMatt
  • 181
  • 1
  • 9