on 07-22-2014 4:12 PM
We are attempting to load an XML file through the API into Crystal Reports 13. We are using this code:
rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rptDoc.Load(@strTemplateLocation);
DataSet ds = new DataSet();
ds.ReadXmlSchema(@strXSDLocation);
ds.ReadXml(@strXMLLocation);
rptDoc.SetDataSource(ds);
try
{
rptDoc.Export();
}
catch(Exception ex)
{
ExceptionManager.InsertException(ex);
throw ex;
}
When we execute this code we get "Failed to load database information"
The RPT was built using the same schema and XML file.
How best to use the API to load complex XML files that work in the designer using the XML and Web Services Connection?
Thanks,
Tom
I am assuming that the report is working fine from designer when you point it to the same XML file (which is you are using in your code.).
See below utility, which will wrtie the DB code for your report.
Run the EXE, load your report and generate the code.
Now use the generated code to develp a new app with your report, it will load the XML for your report.
- Bhushan
Senior Engineer
SAP Active Global Support
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Getting started and moving ahead with Crystal Reports .NET applications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alternatively see the KBA 1203980 - How to change the location of the .XSD and .XML files at runtime in a .NET application
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.