IMBack

Hi,

I am new to Crystal Reports. I found articles how to browse data from database to dataset, and then I am assuming it would populate into crystal report. But what I am looking for is, how to get the data from XML file, than have a business-Layer class that would take the attribute and populate into the rpt's right area.

I appreciate your help, Please advice how should I start.

Thank you very much,



Re: Crystal Reports for Visual Studio load xml data into CR

mewdied

First, you would create the report based off of the xml file, or preferably its schema. At runtime, it will look in the directory for the file it was created against, if it finds it, it will load the data in that file. If you want it to look in a different directory, you have two options. First is to load the report and call the setdatasource method and pass in the new filename as a string. Second option is to read the xml data into a dataset and then pass the dataset to the report using the setdatasource method.





Re: Crystal Reports for Visual Studio load xml data into CR

captJackSparrow

DataSet objDs = new DataSet();

objds.ReadXml(filename); //also check its overloaded methods

now set dataset object as datasource for your report.





Re: Crystal Reports for Visual Studio load xml data into CR

IMBack

Thank you Smile