title: Custom code in Reporting Services report
body: <p>In Reporting Services I would like to add a parameter that contains data from a custom code block.  Ideally, I would be able to run the following code (this is a simple testing example):</p>
  
  <pre><code>Function GetPeriods() As String()
   Dim values As System.Collections.ArrayList = 
      New System.Collections.ArrayList()
   For i as integer = 1 to 24
      values.Add(i)
   Next
   Return values.ToArray()
  End Function
  </code></pre>
  
  <p>and put the following in the "Text Field" of the parameter:</p>
  
  <pre><code>=Code.GetPeriods()
  </code></pre>
  
  <p>However, when I run the report, the parameter I apply this to is disabled and empty. Is there a different technique that should be used?  Or am I doing something wrong?</p>