title: Why do I get "Database logon failed" in Crystal Reports when using .NET object as datasource?
body: <p>I am creating a simple report using a .NET object from my project as datasource, using <code>SetDatasource()</code> method. However, when I run the report I get "Database logon failed" error. This report is not connecting to a DB at all - have I missed something here?</p>
  
  <p>Many thanks,
  D.</p>
  
  <p>ADDED:
  I guess it will probably help if I include the Controller action. It's a quick and dirty test, not what the final method will look like:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public ActionResult StewardSheets(int showId, int groupId)
  {
      ReportClass rptH = new ReportClass();
      rptH.FileName = DataHelper.getReportFilePath("Test.rpt",this);
  
      NZDSDataContext dataContext = new NZDSDataContext();
      var showDetails = (from s in dataContext.Shows
                         where s.ID == showId
                         select new StewardSheetModel
                         {
                             EventDate = s.EventDate.ToLongDateString(),
                             Region = s.Region.Name,
                             ShowTitle = s.Name
                         }).FirstOrDefault();
  
      List&lt;StewardSheetModel&gt; details = new List&lt;StewardSheetModel&gt;();
      details.Add(showDetails);
  
      rptH.SetDataSource(details);
  
      rptH.Refresh();
      Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
      return File(stream, "application/pdf");
  }
  </code></pre>
  
  <p>FIXED:
  D'oh! I used ReportClass instead of ReportDocument. Changed that line, and also use Refresh() since Load() is not a valid method. Now it works just fine!</p>