Crystal Reports不显示数据库中的数据 [英] Crystal Reports not displaying data from database

查看:126
本文介绍了Crystal Reports不显示数据库中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Crystal Reports打印报告的Web表单。数据在数据库中,但打印时报告为空白。为什么会这样?一切都有效。如果我有一份子报告和这份报告会有关系吗?以下是CR查看器的代码。



背后的CRV代码:

I have a web form that prints out a report using Crystal Reports. The data is in the database but the report is blank when printing. Why is this happening? Everything worked before. Will it matter if I had a subreport along with this report? Here is the code for the CR viewer.

CRV code behind:

protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HOTConnectionString"].ConnectionString);
            con.Open();
            TextBoxUser_ID.Text = Session["user_id"].ToString();
            CrystalReportViewer1.Visible = true;

            ReportDocument CrystalReport = new ReportDocument();
            ParameterField paramField = new ParameterField();
            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            paramField.Name = "user_id";
            paramField.CurrentValues.Clear();
            paramDiscreteValue = new ParameterDiscreteValue();
            paramDiscreteValue.Value = TextBoxUser_ID.Text;
            paramFields.Add(paramField);
            CrystalReportViewer1.ParameterFieldInfo = paramFields;


            CrystalReport.Load(Server.MapPath("FormFTEReport40.rpt"));
            string sessiontype = TextBoxUser_ID.Text;
            CrystalReport.SetParameterValue("inst_id", TextBoxUser_ID.Text);
            

            string sessionid = TextBoxUser_ID.Text;
            CrystalReport.SetParameterValue("user_id", TextBoxUser_ID.Text);
            CrystalReportViewer1.ReportSource = CrystalReport;
            con.Close();
        }
    }
}





我错过了什么?



Did I miss something?

推荐答案

我重新链接了子报表的链接。
I relinked my links for the subreport.


这篇关于Crystal Reports不显示数据库中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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