title: passing a parameter to query in MVC4 dataset for RDLC Report
body: <p><strong>Note:</strong> I am using Microsoft Reports in MVC4</p>
  
  <p>I have created a <code>DataSet</code> named DataSet1.xsd in VisualStudio in which i have added a <code>TableAdapter</code> named 'st' and in that tableadapter i have created <code>DataTable</code> named dt1. There are two methods in <code>dt1</code> <code>GetData()</code> and <code>Fill(@p0)</code>.</p>
  
  <p>I have created a new <code>RDLC</code> report which is binded to that <code>DataSet1</code>
  now when i try to generate the report it shows the following error</p>
  
  <pre><code>One or more parameters required to run the report have not been specified.
  </code></pre>
  
  <p>i dont know how to pass parameter at runtime to report </p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public ActionResult Report(string id)
      {
          var lr = new LocalReport();
          var path = Path.Combine(Server.MapPath("~/Reports"), "Report1.rdlc");
          if (System.IO.File.Exists(path))
          {
              lr.ReportPath = path;
          }
          else
          {
              return View("Index");
          }
  
          var reportType = id;
          string mimeType;
          string encoding;
          string fileNameExtension;
  
  
  
          var deviceInfo =
  
          "&lt;DeviceInfo&gt;" +
          "  &lt;OutputFormat&gt;" + id + "&lt;/OutputFormat&gt;" +
          "  &lt;PageWidth&gt;8.5in&lt;/PageWidth&gt;" +
          "  &lt;PageHeight&gt;11in&lt;/PageHeight&gt;" +
          "  &lt;MarginTop&gt;0.5in&lt;/MarginTop&gt;" +
          "  &lt;MarginLeft&gt;1in&lt;/MarginLeft&gt;" +
          "  &lt;MarginRight&gt;1in&lt;/MarginRight&gt;" +
          "  &lt;MarginBottom&gt;0.5in&lt;/MarginBottom&gt;" +
          "&lt;/DeviceInfo&gt;";
  
          Warning[] warnings;
          string[] streams;
  
          var renderedBytes = lr.Render(
              reportType,
              deviceInfo,
              out mimeType,
              out encoding,
              out fileNameExtension,
              out streams,
              out warnings);
  
  
          return File(renderedBytes, mimeType);
          }
  }
  </code></pre>
  
  <p>i have tried the following ways to add parameters but finds no success</p>
  
  <pre><code>var param0 = new ReportParameter("p0", "1");
  rl.SetParameters(new[]{param0});
  </code></pre>