Print Page | Close Window

xml local data source +xsd / C#

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17783
Printed Date: 02 May 2024 at 10:45am


Topic: xml local data source +xsd / C#
Posted By: chrbruno
Subject: xml local data source +xsd / C#
Date Posted: 16 Oct 2012 at 9:55pm
Hello,

i have created a report based on an xml data file and an xsd schema, using an connection based on "XML and Web Service" with a local data source.

I have not found a way to provide different data than the XML file, using a program written in C# (it fails even when I provide the same data, using dataset)

the code is :

DataSet ds = new DataSet();
ds.ReadXml("the_same_xml_file");
CrystalReportSource1.Report.FileName = "reports/report1.rpt";
CrystalReportSource1.ReportDocument.SetDataSource(ds);

No exception is generated, but the ASP.NET page that contains the report viewer displays a gray box with message "error loading database informations, error in file report1 {C24095F4-5F0B-44E5-9E3A-54562AE7ADC4}.rpt" (translated from french)

please, could you tell me what to check, or point me to sample code ?

Thanks in advance for your help

Regards
Christian



Replies:
Posted By: lockwelle
Date Posted: 18 Oct 2012 at 4:53am
never used the "xml and web service" datasource. I have used the ADO.Net datasource and the xml file fine for years...
that might be worth a try.
 
they only other thing that comes to mind is that perhaps the relative path is incorrect, but if the report is displaying correctly (except for the gray box...) then that is probably not it.
 
our app passes the report and sets the data in a common object, so I am using different code...also our reports are embedded in the app (well a related dll really but minor difference)
 
hope some of this is useful and guides you to a solution.



Print Page | Close Window