Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
C#
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?
Posted
Updated 10-Nov-14 5:50am
v2

1 solution

I relinked my links for the subreport.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900