title: How to Use String.Filter with Multi-Value Parameters
body: <p>In the Expression builder window in SQL Server Reporting Services 2008 R2 under Common Functions -> Text -> Item, there is an expression called Filter.  This appears to correspond with the <a href="http://msdn.microsoft.com/en-us/library/h6ctk5wk.aspx" rel="nofollow noreferrer">Strings.Filter method</a> in the .NET framework.  The description of Filter is as follows:</p>
  
  <p>Returns a zero-based array containing a subset of a String array based on specified filter criteria.</p>
  
  <p>The Example is as follows:</p>
  
  <pre><code>=Filter(Parameters!MultivalueParameter.Value, "3", True, CompareMethod.Binary)
  </code></pre>
  
  <p>The example and description imply that you can inspect a multi-value parameter to see if at least one of the selected values is equal to the Match parameter.  I haven't been able to get this to return anything other than #Error which implies the multi-value parameter is not a one-dimensional array.  Parameters!MultivalueParameter.Value.GetType().ToString() returns System.Object[].</p>
  
  <p>Does anyone know how to get this to work?  I'm using the following work around to check if values were selected in the multi-value parameter:</p>
  
  <pre><code>=IIF(InStr(" " + JOIN(Parameters!MultivalueParameter.Value, " ") + " ", " 3 ", CompareMethod.Text), false, true)
  </code></pre>
  
  <p>The above code works, but it is pretty ugly.  I would prefer to use the Filter function if it supports this kind of check.  Can anyone give an example of code that works?</p>