【发布时间】:2014-05-19 12:32:18
【问题描述】:
我在 VS2013 中使用 Devexpress。我想知道如何在 Devexpress 报告(XtraReport)中使用我的实体框架类作为数据源。例如,我的 DBcontext 中有一个 DBset“Employs”,如何在 Xtrareport 数据源中使用它,
谢谢。
【问题讨论】:
标签: devexpress xtrareport
我在 VS2013 中使用 Devexpress。我想知道如何在 Devexpress 报告(XtraReport)中使用我的实体框架类作为数据源。例如,我的 DBcontext 中有一个 DBset“Employs”,如何在 Xtrareport 数据源中使用它,
谢谢。
【问题讨论】:
标签: devexpress xtrareport
如果您将查询转换为List,然后将您的报告绑定到此列表,则可以轻松地将报告绑定到 EF 查询结果:
report.DataSource = (from employee in DbContext.Employees
select employee).ToList();
我相信以下知识库文章会有所帮助:
How to create a master-detail report bound to an ORM (Entity Framework) model in MVC applications
【讨论】: