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");
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
Database logon failed.
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.
Exception Details: System.Runtime.InteropServices.COMException: Database logon failed.
Source Error:
Line 19: //crvReport.ReportSource = DAC.GenerateReport(Report, Query); Line 20: //crvReport.ID = ReportName; Line 21: crystalReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"D:\ASD.pdf");