Export report in .NET with data in XML file
I have a report with the data in a XML file. In the report definition, the link with XML file is relative path, only “myxmlfile.xml” and “myxsdfile.xsd”. In my code, I want load this report and exported to the disk in PDF file or to printer.
If I don’t launch the preview the report before in the Crystal Designer, my code don’t work and I have a error “CrystalDecisions.CrystalReports.Engine.LogOnException : Echec de connexion à la base de données” : failed to connect to the database.
Have you got any solution , please ?
This is my code :
ReportDocument rptXml = new ReportDocument(); rptXml.Load("myrptfile.rpt"); rptXml.ExportToDisk(ExportFormatType.PortableDocFormat, "res.pdf");