Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptChiTieuTrongKhoan rpt = new crptChiTieuTrongKhoan();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        public void BaoCaoChiTieuTrongKhoan(DateTime tuNgay, DateTime denNgay)
        {
            cmd.CommandText = "select pnh.MAPNH, nv.TENNV, pnh.NGAYLAP, ncc.TENNCC, Sum(ct.SL*ct.GIA) as TONGTIEN"
                              + " from PHIEU_NHAP_HANG pnh, CHI_TIET_PHIEU_NHAP_HANG ct, NHAN_VIEN nv, NHA_CUNG_CAP ncc"
                              + " where pnh.MAPNH=ct.MAPNH and pnh.MANVLAP=nv.MANV and pnh.MANCC=ncc.MANCC and pnh.NGAYLAP>='" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", tuNgay) + "' and pnh.NGAYLAP<='" + string.Format("{0:yyyy-MM-dd HH:mm:ss}", denNgay) + "'"
                              + " group by pnh.MAPNH, nv.TENNV, pnh.NGAYLAP, ncc.TENNCC";
            da.SelectCommand = cmd;

            DataTable dt = new DataTable("ChiTieuTrongKhoan");

            da.Fill(dt);

            crptChiTieuTrongKhoan rp = new crptChiTieuTrongKhoan();

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