title: How can I pass parameter to Reportviewer?
body: <p>I am trying to create report for TOP (according to user provide say 10,100,200..) products. I am 90% success with it. Now, I am finding difficulties to show this numbers to Report header. So, my report header is saying Top Products, now I want to make this dynamic, saying Top 100 Products, Top 200 Products. </p>
  
  <p>I AM USING VS 2008.</p>
  
  <p>For this, I created parameter in ReportViewer. I tried this code in Page_Load event ;</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
  {
      ReportDataSource rds = new ReportDataSource("SP_GetProductsbySales_DataSet");
      //ReportViewer1.ServerReport.ReportPath = "Report1.rdlc";
      ReportViewer1.LocalReport.ReportPath = "Report1.rdlc";
      ReportParameter[] param = new ReportParameter[1];
      param[0] = new ReportParameter("top", "100");
  
      ReportViewer1.ServerReport.SetParameters(param);
      ReportViewer1.ServerReport.Refresh();
  }
  </code></pre>
  
  <p>but getting error saying : <code>The source of the report definition has not been specified.</code></p>
  
  <p>How can I accomplish this one? I tried to google as well as watched some videos, but still I am not getting any idea.</p>
  
  <p>Thanks.</p>