Sample for XMLDatabase

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Sample for XMLDatabase

Post by tpontow »

Hello,

is there a more complex sample for using XML as report datasource available? I would like to assign XML data and XSD schema file at runtime before rendering the report?

Thanks
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Sample for XMLDatabase

Post by HighAley »

Hello.

Here is a sample code how to use XML data:
DataSet demoDataSet = new DataSet();
demoDataSet.ReadXmlSchema(@"D:\Data.xsd");
demoDataSet.ReadXml(@"D:\Data.xml");

rep.Dictionary.Databases.Clear(); // Remove all Connections
rep.Dictionary.DataSources.Clear(); // Remove all Data Sources
rep.Dictionary.ImportXMLSchema(demoDataSet);
rep.RegData(demoDataSet);
rep.Dictionary.Synchronize() // This method could be use instead of ImportXMLSchema() method.
You should remove all Data Sources and Connections if there is any one in your report to prevent a naming collision.

Thank you.
Post Reply