ReportDocument rptdoc = new ReportDocument(); private void bindreport() { con.Open(); string filepath = Server.MapPath("~/")+"Reports/SampleCrystalReport.rpt"; rptdoc.Load(filepath); DataTable dt = new DataTable(); SqlCommand cmd = new SqlCommand("select * from tblEmp", con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); if (dt.Rows.Count != 0) { rptdoc.SetDataSource(dt); CrystalReportViewer1.ReportSource = rptdoc; CrystalReportViewer1.DataBind(); } con.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)