title: I am getting the following error:Value cannot be null. Parameter name: reportParameters.Any ideas how to fix it?
body: <p>I created a report using VSS reportviewer. This report has one parameter - a username.</p>
  
  <p>The idea is that when a user clicks the <code>Print</code> icon to print a report, only records belonging to him/her will be displayed for printing, based on his/her logged in username.</p>
  
  <p>I tested the .rdlc with hardcoded values and it works fine.</p>
  
  <p>I am trying to integrate this report with my .net app and I am running into the following error:</p>
  
  <pre><code>Value cannot be null. Parameter name: reportParameters
  </code></pre>
  
  <p>This error is on this line:</p>
  
  <pre><code>ReportViewer1.LocalReport.SetParameters(params)
  </code></pre>
  
  <p>Relevant data is below.</p>
  
  <pre><code>    Protected Sub btnUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUser.Click
          which.Value = "U"
          Call Run_Report("")
      End Sub
  
  Sub Run_Report(ByVal sel As String)
      ReportViewer1.Reset()
      ReportViewer1.LocalReport.DataSources.Clear()
      Dim params(0) As ReportParameter
  
      Select Case which.Value
          Case "U"
              ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("MyReporttSet", ObjectDataSource1.ID))
              ReportViewer1.LocalReport.ReportPath = "MyReport.rdlc"
              ReportViewer1.LocalReport.Refresh()
              ReportViewer1.LocalReport.SetParameters(params)
      End Select
  End Sub
  </code></pre>
  
  <p>Any ideas on how to fix this?</p>
  
  <p>Thanks alot in advance.</p>