如何以编程方式将XML文件绑定为Telerik Reporting数据源?

时间:2017-09-01 13:03:06

标签: c# xml telerik reporting telerik-reporting

我想将XML文件绑定为Telerik reportViewer的数据源。 我尝试了这段代码但没有工作:

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 个答案:

没有答案