如何将水晶报表绑定到实体框架? [英] HowTo Bind Crystal Reports to Entity Framework?

查看:198
本文介绍了如何将水晶报表绑定到实体框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Crystal Reports与实体框架实体绑定?

How can one bind Crystal Reports to Entity Framework Entities?

我没有找到解决方法。

推荐答案

对我来说,我阅读下面的链接

As for me, I read below link

http://aspalliance.com/2049_Use_LINQ_to_Retrieve_Data_for_Your_Crystal_Reports.2

它告诉我如何链接EntityFramework和Crystal Report。

It tell me how to link EntityFramework and Crystal Report.

 protected void Page_Load(object sender, EventArgs e)
 {
        Report.CrystalReport1 _Rpt = new Report.CrystalReport1();            

        List<Test> list_Test = new List<Test>();
        using (tempdbEntities _tempdbEntities = new tempdbEntities()) {
            list_Test = _tempdbEntities.Tests.ToList();
        }

        _Rpt.SetDataSource(list_Test);
        CrystalReportViewer1.ReportSource = _Rpt;
        CrystalReportViewer1.RefreshReport();

}

这篇关于如何将水晶报表绑定到实体框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆