title: crystal report failed
body: <p>I've created a crystal report with parameter,but it does not load the value. It simply shows the heading only, I mean column names only. Please check my code and correct me. And I was tried in that to load the report to pdf format, that shows an error like "load report failed". Please correct me.</p>
  
  <pre><code>protected void Button2_Click(object sender, EventArgs e)
      {
          ReportDocument reportdocument = new ReportDocument();
          reportdocument.Load(Server.MapPath("CrystalReport.rpt"));
          reportdocument.SetDatabaseLogon("", "", "Aravind", "MySampleDB");
          reportdocument.SetParameterValue("MRNO", TextBox1.Text);
          CrystalReportViewer1.ReportSource = reportdocument;
      }
      protected void LinkButton1_Click(object sender, EventArgs e)
      {
          EXPORTREPORT();
      }
      private void EXPORTREPORT()
      {
          MemoryStream oStream;
          Response.Clear();
          Response.Buffer = true;
          ReportDocument reportdocument = new ReportDocument();
          reportdocument.Load(Server.MapPath("CrystalReort.rpt"));
          reportdocument.SetDatabaseLogon("", "", "Aravind", "MySampleDB");
          reportdocument.SetParameterValue("MRNO",TextBox1.Text);
          CrystalReportViewer1.ReportSource = reportdocument;
  
          oStream = (MemoryStream)reportdocument.ExportToStream(ExportFormatType.PortableDocFormat);
          //oStream = (MemoryStream)crReport.ExportToStream(ExportFormatType.PortableDocFormat);
          Response.ContentType = "application/pdf";
          try
          {
  
              //write report to the Response stream
  
              Response.BinaryWrite(oStream.ToArray());
  
              Response.End();
  
          }
  
          catch (Exception ex)
          {
              Label2.Visible = true;
              Label2.Text = "ERROR:" + Server.HtmlEncode(ex.Message.ToString());
  
  
          }
  
          finally
          {
  
              //clear stream
  
              oStream.Flush();
  
              oStream.Close();
  
              oStream.Dispose();
  
          }
  </code></pre>