How to programmatically bind XML file as Telerik Reporting datasource?

322 views Asked by At

I want to bind a XML file as datasource of Telerik reportViewer. I tried this code but not working:

DataSet rptDataSet = new DataSet();
rptDataSet.ReadXml(//filepath);
var objectDataSource = new Telerik.Reporting.ObjectDataSource();                       
var report = new Telerik.Reporting.Report();
var reportSource = new Telerik.Reporting.InstanceReportSource();

objectDataSource.DataSource = rptDataSet;                        
report.DataSource = objectDataSource;
reportSource.ReportDocument = report;
reportViewer1.ReportSource = reportSource;
reportViewer1.RefreshReport();
0

There are 0 answers