title: Crystal report method not found
body: <p>I made a feedback project. I made it on ASP.NET MVC 5 it also has crystal reports. reports were working fine, but suddenly they stopped to work. I don't what happened with them. but since last week I tried hard to find solution but unfortunately could not get the right one who solved the solution. I downloaded different run times but all went vain. this is the bottom line of error.</p>
  
  <blockquote>
    <p>"Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'"
    this is the code:</p>
  </blockquote>
  
  <p>public CrystalReportFeedback UserFeedbackDateWise(FeedbackReport be){</p>
  
  <pre><code>        if (Session["CurrentUser"] != null &amp;&amp; Convert.ToInt32(Session["User_Id"]) != 0)
          {
              string reportPath = Path.Combine(Server.MapPath("~/Reports"), "UserFeedbackReport.rpt");
              if (ModelState.IsValid)
              {
                  be.FromDate = Convert.ToDateTime(TempData["UserFromDate"]);
                  be.ToDate = Convert.ToDateTime(TempData["UserToDate"]);
                  be.User_Id = Convert.ToInt32(Session["User_Id"]);
              }
              return new CrystalReportFeedback(reportPath, be);
          }
          else
          {
              return null;
              //new CrystalReportFeedback(reportPath, be);
          }
      }
  </code></pre>
  
  <p>Init of the report : </p>
  
  <pre><code>public CrystalReportFeedback(string reportPath, FeedbackReport be)//, object dataSet)
          {
              //int[] array;
              string strConnect = Convert.ToString(System.Configuration.ConfigurationManager.ConnectionStrings["TSC"]);
              SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(strConnect);
              string _username = builder.UserID;
              string _pass = builder.Password;
              string _server = builder.DataSource;
              string _database = builder.InitialCatalog;
              ReportDocument reportDocument = new ReportDocument();
              //
              reportDocument.Load(reportPath);
              reportDocument.SetDatabaseLogon(_username, _pass, _server, _database);
              if (be.Region_Id != 0)
              {
                  reportDocument.SetParameterValue("@Region_Id", be.Region_Id);
              }
              if (be.User_Id != 0)
              {
                  reportDocument.SetParameterValue("@User_Id", be.User_Id);
              }
              reportDocument.SetParameterValue("@FromDate", be.FromDate);
              reportDocument.SetParameterValue("@ToDate", be.ToDate);
              //reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "C:\report.pdf");
              _contentBytes = StreamToBytes(reportDocument.ExportToStream(ExportFormatType.PortableDocFormat));
          }
  </code></pre>
  
  <p>Export method :</p>
  
  <pre><code>    public override void ExecuteResult(ControllerContext context)
      {
  
          var response = context.HttpContext.ApplicationInstance.Response;
          response.Clear();
          response.Buffer = false;
          response.ClearContent();
          response.ClearHeaders();
          response.Cache.SetCacheability(HttpCacheability.Public);
          response.ContentType = "application/pdf";
  
          using (var stream = new MemoryStream(_contentBytes))
          {
              stream.WriteTo(response.OutputStream);
              stream.Flush();
          }
      }
  
      private static byte[] StreamToBytes(Stream input)
      {
          byte[] buffer = new byte[16 * 1024];
          using (MemoryStream ms = new MemoryStream())
          {
              int read;
              while ((read = input.Read(buffer, 0, buffer.Length)) &gt; 0)
              {
                  ms.Write(buffer, 0, read);
              }
              return ms.ToArray();
          }
      }
  </code></pre>
  
  <p>Hope that I will get my solution at earliest. </p>
  
  <p>this is modified code:</p>
  
  <p>[HttpGet]</p>
  
  <pre><code>    public FileResult UserFeedbackDateWise(FeedbackReport be)
      {
  
          if (Session["CurrentUser"] != null &amp;&amp; Convert.ToInt32(Session["User_Id"]) != 0)
          {
              string reportPath = Path.Combine(Server.MapPath("~/Reports"), "UserFeedbackReport.rpt");
              if (ModelState.IsValid)
              {
  
                  be.FromDate = Convert.ToDateTime(TempData["UserFromDate"]);
                  be.ToDate = Convert.ToDateTime(TempData["UserToDate"]);
                  be.User_Id = Convert.ToInt32(Session["User_Id"]);
              }
              string strConnect = Convert.ToString(System.Configuration.ConfigurationManager.ConnectionStrings["TSC"]);
              SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(strConnect);
              string _username = builder.UserID;
              string _pass = builder.Password;
              string _server = builder.DataSource;
              string _database = builder.InitialCatalog;
              ReportDocument reportDocument = new ReportDocument();
              //
              reportDocument.Load(reportPath);
              reportDocument.SetDatabaseLogon(_username, _pass, _server, _database);
              if (be.Region_Id != 0)
              {
                  reportDocument.SetParameterValue("@Region_Id", be.Region_Id);
              }
              if (be.User_Id != 0)
              {
                  reportDocument.SetParameterValue("@User_Id", be.User_Id);
              }
              reportDocument.SetParameterValue("@FromDate", be.FromDate);
              reportDocument.SetParameterValue("@ToDate", be.ToDate);
  
              Stream stream = reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
  
              //Here i have my stream with my pdf report, i just create a new FileStreamResult and return it to my client like that : 
              FileStreamResult myfile = new FileStreamResult(stream, "application/pdf");
              return myfile;
                  //new CrystalReportFeedback(reportPath, be);
          }
          else
          {
              return null;
              //new CrystalReportFeedback(reportPath, be);
          }
      }
  </code></pre>