コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptDoanhThuTrongKhoan rpt = new crptDoanhThuTrongKhoan();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        public void BaoCaoDoanhThuTrongKhoan(DateTime tuNgay, DateTime denNgay)
        {
            cmd.CommandText = "select hd.MAHD, nv.TENNV, hd.NGAYLAP, b.TENBAN, Sum(ct.SL*ct.GIABAN) as TONGTIEN"
                              + " from HOA_DON hd, CHI_TIET_HOA_DON ct, NHAN_VIEN nv, BAN b"
                              + " where hd.MAHD=ct.MAHD and hd.MANVLAP=nv.MANV and hd.SOBAN=b.SOBAN and hd.TRANGTHAI=1 and hd.NGAYLAP>='" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", tuNgay) + "' and hd.NGAYLAP<='" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", denNgay) + "'"
                              + " group by hd.MAHD, nv.TENNV, hd.NGAYLAP, b.TENBAN";
            da.SelectCommand = cmd;

            DataTable dt = new DataTable("DoanhThuTrongKhoanTG");

            da.Fill(dt);

            crptDoanhThuTrongKhoan rp = new crptDoanhThuTrongKhoan();

            rp.SetDataSource(dt);
            crystalReportViewer1.ReportSource = rp;
        }