private void frmDoctorExperience_Load(object sender, EventArgs e) { CrystalReportDoctorExperience cr = new CrystalReportDoctorExperience(); SqlConnection conn = new SqlConnection(); conn = DbConnection.getConnection(); conn.Open(); string sql = "select * from doctorexperience order by experience desc"; DataSet ds = new DataSet(); SqlDataAdapter adapter = new SqlDataAdapter(sql, conn); adapter.Fill(ds, "doctorexperience"); DataTable dt = ds.Tables["doctorexperience"]; cr.SetDataSource(ds.Tables["doctorexperience"]); crystalReportViewer1.ReportSource = cr; crystalReportViewer1.Refresh(); conn.Close(); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReportDoctorExperience rpt = new CrystalReportDoctorExperience(); rpt.Site = this.Site; return rpt; }