我正在尝试将一个xtraReport-EFdatasource绑定到一个列表,我已经在设计器模式下使用向导快速完成了绑定,但我无法在运行时绑定它的数据源。
DataSource = Services.CoursesList();我在报告构造函数中尝试了这段代码,在XtraReport1_DataSourceDemanded事件中也是如此,但没有成功。devexpress网站显示了一个使用bindingsource的示例,但我使用的是EFdatasource。你能帮我拿一个代码样本吗?
发布于 2016-07-18 22:07:47
我建议你参考这个- How to use Entity Framework with Xtrareports
完成任务的最佳方法是将报表类和实体对象放入单独的类库中。在这种情况下,您将能够bind the Report to a custom object at design time and provide data at run time。
若要将数据传递给报表实例,请处理XtraReport.DataSourceDemanded event,创建Entity对象,并将它们传递给XtraReport.DataSource属性。
更多参考资料:
https://stackoverflow.com/questions/38379298
复制相似问题