narasiman rao

narasiman rao

  • NA
  • 519
  • 767.1k

when i run the Load Report Failed.

Oct 20 2012 2:50 AM
protected void Button5_Click(object sender, EventArgs e)
    {
        con = new SqlConnection("Server=(local);initial catalog=master;Trusted_Connection=True");
        con.Open();
        string str = "select * from Empdet where EmployeeID='" + DropDownList1.SelectedValue + "'";
        SqlCommand com = new SqlCommand(str, con);
        SqlDataAdapter sqlda = new SqlDataAdapter(com);
        DataSet ds = new DataSet();
        sqlda.Fill(ds, "Empdet");
        con.Close();

          ReportDocument r1 = new ReportDocument();
        //r1.Load("Full Path of Your Report\Employee.rpt");
          string  path = Server.MapPath("Reports/Employee.rpt");
          r1.Load(path);
          r1.SetDataSource(ds);
          CrystalReportViewer1.ReportSource = r1;
          CrystalReportViewer1.RefreshReport();
    }

When i run all the employee details are appear in the run mode.

Textbox    Button.

in textbox i type the partiuclar employee id and click the button the following error occurs as follows Load Report Failed.

Answers (1)