public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptVatTu rpt = new rptVatTu(); rpt.Site = this.Site; return(rpt); }
//Download source code tại Sharecode.vn private void frmBaoCaoVatTu_Load(object sender, EventArgs e) { SqlConnection sqlConn = new SqlConnection(@"Data Source=DESKTOP-AQEI1KT\SQLEXPRESS;Initial Catalog=khomaytinh;Integrated Security=True"); string sql = "SELECT *FROM VATTU"; SqlDataAdapter sqlDa = new SqlDataAdapter(sql, sqlConn); DataTable dt = new DataTable(); sqlDa.Fill(dt); rptVatTu cr = new rptVatTu(); cr.SetDataSource(dt); crystalReportViewer1.ReportSource = cr; }
private void frmBaoCaoVatTu_Load(object sender, EventArgs e) { SqlConnection sqlConn = new SqlConnection(@"server = HP-91149BFA9401\SQLEXPRESS;uid = admin;pwd=admin"); string sql = "SELECT *FROM VATTU"; SqlDataAdapter sqlDa = new SqlDataAdapter(sql, sqlConn); DataTable dt = new DataTable(); sqlDa.Fill(dt); rptVatTu cr = new rptVatTu(); cr.SetDataSource(dt); crystalReportViewer1.ReportSource = cr; }