title: Export crystal report to PDF
body: <pre><code>ReportDocument crystalReport = new ReportDocument();
              crystalReport.Load(Server.MapPath(Report));
              crystalReport.SetDatabaseLogon("glfuser", "glfuserpass", "glfcol", "");
              crvReport.RefreshReport();
              crvReport.ReportSource = DAC.GenerateReport(Report, Query);
              crvReport.ID = ReportName;
          crystalReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"D:\ASD.pdf");
  </code></pre>
  
  <p>Trying to export my report in PDFformat in my local PC after I get report in report viewer. I am getting report but when I am trying to export it with ExportToDisk method I get error</p>
  
  <blockquote>
    <p>Database logon failed.</p>
    
    <p>Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.Runtime.InteropServices.COMException:
    Database logon failed.</p>
    
    <p>Source Error: </p>
    
    <p>Line 19:             //crvReport.ReportSource =
    DAC.GenerateReport(Report, Query); Line 20:             //crvReport.ID
    = ReportName; Line 21:             crystalReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
    @"D:\ASD.pdf");</p>
  </blockquote>