Crystal报告显示C#framework 4.5,visual studio 2012中没有数据 [英] Crystal report shows no data in C# framework 4.5, visual studio 2012

查看:84
本文介绍了Crystal报告显示C#framework 4.5,visual studio 2012中没有数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的C#代码,

Here is my C# code,

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                ReportDocument crystalReport = new ReportDocument();
                crystalReport.Load(Server.MapPath("~\\CrystalReport.rpt"));

                DataTable dt = new DataTable();
                dt = GetData();

                crystalReport.SetDataSource(dt); //error occurs on this line
                
                CrystalReportViewer1.ReportSource = crystalReport;
                CrystalReportViewer1.DataBind();
            }
            catch (Exception ex) { Response.Write(ex); }
        }        
    }
    private DataTable GetData()
    {
        string constr = ConfigurationManager.ConnectionStrings["DBCarUAE"].ConnectionString;
        using (SqlConnection con = new SqlConnection(constr))
        {
            using (SqlCommand cmd = new SqlCommand("SELECT F_Name, L_Name,E_Mail from VendorRegistration"))
            {
                using (SqlDataAdapter sda = new SqlDataAdapter())
                {
                    cmd.Connection = con;
                    sda.SelectCommand = cmd;
                    cmd.CommandTimeout = 0;
                    using (DataTable dsCustomers = new DataTable())
                    {
                        sda.Fill(dsCustomers);
                        return dsCustomers;
                    }
                }
            }
        }
    }



当我运行此代码时,调试器显示错误:

功能评估已禁用,因为之前的功能评估已超时。您必须继续执行以重新启用功能评估。



请帮我解决这个问题。

提前致谢。


When i run this code, debugger shows error :
"Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation."

Please help me to get over this.
Thanks in advance.

推荐答案

试试这个链接< br $> b $ b

http://forums.asp.net/t/1986530.aspx?Hi+All+Please+Help+my+crystal+report+is任何+数据+后+ +显示+任何+数据+ +运行后+ +报告+ [ ^ ]


这篇关于Crystal报告显示C#framework 4.5,visual studio 2012中没有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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