Skip to Content
0

Export report in .NET with data in XML file

Oct 12, 2016 at 11:02 AM

16

avatar image

Hello,

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");
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Don Williams
Oct 12, 2016 at 02:11 PM
0

Post to:

SAP Crystal Reports, version for Visual Studio

Share
10 |10000 characters needed characters left characters exceeded