我想将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();