title: Passing ReportParameters back to method
body: <p>I have an application that is doing all of our reporting with locally stored RDLs. I have two forms, one is a simple viewer that contains a TabPageControl, and the other is an FLP of controls that the user can use to select report parameters. We are planning on having over 30+ options, but at the moment we only have around 5 (certain ones display for certain reports, the rest are hidden).</p>
  
  <p>The issue I'm running into is that I need to have some way to get the options they chose out of a List or Collection. The method I'm using right now is</p>
  
  <pre><code>public void AddReportToViewer(string reportName, List&lt;ReportParameter&gt; parameterList = null)
      {
          TabPage newPage = new TabPage();      
          ReportViewer reportViewer = new ReportViewer();
  
          newPage.Text = reportName;
          newPage.Controls.Add(reportViewer);
  
          tbcReports.TabPages.Add(newPage); //adding the report viewer to page, should do this at the end of the method
  
          reportViewer.Reset();
          reportViewer.ProcessingMode = ProcessingMode.Local;
          reportViewer.LocalReport.ReportPath = "MyPath/reportName";
          ReportDataSource rds = new ReportDataSource();
  
          //parse parameters to individual objects to use with method calls
  
          int parameterEmployeeID = 0;
          int parameterStoreID = 0;
          List&lt;int&gt; parameterStoreIDs = null;
          DateTime parameterFromDate = DateTime.Now;
          DateTime parameterToDate = DateTime.Now;
  
          //Use parameters to get objects, just one here, but we have multiple
  
          List&lt;EmployeeTimeclockReportObjects&gt; timeclock = reportBL.getEmployeeTimeclock(parameterEmployeeID, parameterStoreID, parameterFromDate, parameterToDate);
          reportBindingSource.DataSource = timeclock;
          rds = new ReportDataSource("TimeclockEntries", reportBindingSource);
          reportViewer.LocalReport.DataSources.Add(rds);
  
          reportViewer.RefreshReport();
          reportViewer.Dock = DockStyle.Fill;            
      }
  </code></pre>
  
  <p>This all works, but here's where I need help</p>
  
  <pre><code>        int parameterEmployeeID = 0;
          int parameterStoreID = 0;
          List&lt;int&gt; parameterStoreIDs = null;
          DateTime parameterFromDate = DateTime.Now;
          DateTime parameterToDate = DateTime.Now;
  </code></pre>
  
  <p>I need to strip the values from the list of report parameters so I can use them in the data population methods. For example, I'm doing something like...</p>
  
  <pre><code>int parameterEmployeeID = Convert.ToInt32(parameterList[parameterList.FindIndex(x =&gt; x.Name == "employeeID")].Values[0]);
  </code></pre>
  
  <p>But then I run into issues on the <code>List&lt;int&gt; parameterStoreIDs</code>, because I can't convert a StringCollection to a List of ints. </p>
  
  <p>Does anyone have any recommendations on either a) converting the StringCollection to a list of ints, or b) anything else I could try doing to get the information back from the second form besides a <code>List&lt;ReportParameters&gt;</code> ???</p>