title: How do I fill a dataset in an SSRS subreport?
body: <p>This seems like it should be trivial but I'm having difficulties.</p>
  
  <p>I have a main report, I have been filling datasets as follows in <code>ReportViewer.aspx.cs.</code></p>
  
  <pre><code>ReportViewer.LocalReport.ReportPath = "~/SummaryReport.rdlc";
  ReportDataSource requestsSource = new ReportDataSource();
  requestsSource.Name = "RequestHeadersDataSet";
  requestsSource.Value = GetSummaryRequestsDataSet(); // Returns DT
  ReportViewer.LocalReport.DataSources.Add(requestsSource);
  </code></pre>
  
  <p>I also have a subreport, which is referenced in my main report within a row-group in a table. The dataset has column <code>RequestName</code>. I pass this in through the Subreport Properties in the Parameters tab.</p>
  
  <p>As soon as I add a dataset to the subreport, I get an error: <code>Data retrieval failed for the subreport.</code> Unsurprising, considering I never filled it with anything.</p>
  
  <p>But how can I add to the subreport datasource? The reportpath for ReportViewer is set to my main report.</p>
  
  <p>Both use the same dataset, if this is of any consequence.</p>