I am trying to export crystal report into pdf in Windows Form application.My Crystal Report is getting data from the Mysql Database.Here is my code for the same..
ReportDocument doc = new ReportDocument();
doc.Load("CrystalReport1.rpt");
doc.SetDataSource(dttable);
SaveFileDialog saveas = new SaveFileDialog();
saveas.Filter = "*.pdf|(PDF File)";
if (saveas.ShowDialog() == DialogResult.OK)
{
doc.ExportToDisk(ExportFormatType.PortableDocFormat, saveas.FileName + ".pdf");
MessageBox.Show("Report Exported !");
}
On running the above code. I am getting error
'Load report failed' at line
doc.Load("CrystalReport1.rpt");
Please help me resolve this.