public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptTongHopDT rpt = new rptTongHopDT(); rpt.Site = this.Site; return(rpt); }
private void btnInBC_Click(object sender, EventArgs e) { sql = "SELECT CT_Ban.MaThuoc, Thuoc.Tenthuoc, CT_Ban.Soluong, CT_Ban.Giaban, HdBan.Ngayban" + " FROM CT_Ban INNER JOIN HdBan ON CT_Ban.MaHd = HdBan.MaHd INNER JOIN " + " Thuoc ON CT_Ban.MaThuoc = Thuoc.MaThuoc" + " where Ngayban between'" + dateTuNgay.Value + "' and '" + dateDenngay.Value + "'"; da = new SqlDataAdapter(sql, conn); dtreport.Clear(); da.Fill(dtreport); rptTongHopDT rpt = new rptTongHopDT(); rpt.SetDataSource(dtreport); rpt.DataDefinition.FormulaFields["tungay"].Text = "'" + dateTuNgay.Value + "'"; rpt.DataDefinition.FormulaFields["denngay"].Text = "'" + dateDenngay.Value + "'"; frmThdoanhthuViewer f = new frmThdoanhthuViewer(rpt); f.Show(); this.Close(); }
public frmThdoanhthuViewer(rptTongHopDT rpt) { InitializeComponent(); crystalReportViewer1.ReportSource = rpt; }