public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReportXEMKHOQUY rpt = new CrystalReportXEMKHOQUY(); rpt.Site = this.Site; return(rpt); }
private void buttonVIEW_Click(object sender, EventArgs e) { var _from = dateTimePickerFROM.Value.Date; BindingSource bs = new BindingSource(); CrystalReportXEMKHOQUY rpt = new CrystalReportXEMKHOQUY(); List <CXemKhoQuy> list = new List <CXemKhoQuy>(); var khos = MKho.Get(MKho.KHO_HANG).OrderBy(u => u.NAME); foreach (KHO k in khos) { CXemKhoQuy c = new CXemKhoQuy(); c.KHO = k.NAME; c.CHI = MKho.Total_Chi(k.ID, _from, _from); c.THU = MKho.Total_Thu(k.ID, _from, _from); c.TONGTIEN = c.THU - c.CHI; list.Add(c); } bs.DataSource = list; rpt.SetDataSource(bs); rpt.SetParameterValue("DATE", _from); rpt.SetParameterValue("COMP", ConstClass.COMPANY_NAME); crystalReportViewer1.ReportSource = rpt; }