예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpTongDoanhThu rpt = new rpTongDoanhThu();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void frmThongKeDoanhThu_Load(object sender, EventArgs e)
        {
            DataTable   dt = new DataTable();
            classKetNoi kn = new classKetNoi();

            dt = kn.laybang("SELECT DONHANG.MaHD, KHACHHANG.TenKH, KHACHHANG.MaKH, KHACHHANG.SoDT, SANPHAM.TenSP, SANPHAM.DonVi, SANPHAM.DonGia, CTHD.SoLuong, SANPHAM.SoLuong AS SoLuongTrongKho, SANPHAM.GiaGoc,  CTHD.SoLuong * SANPHAM.DonGia AS ThanhTien, CTHD.SoLuong * SANPHAM.GiaGoc AS TienChi, (SANPHAM.DonGia - SANPHAM.GiaGoc) * CTHD.SoLuong AS TienLoi FROM DONHANG INNER JOIN CTHD ON DONHANG.MaHD = CTHD.MaHD INNER JOIN KHACHHANG ON DONHANG.MaKH = KHACHHANG.MaKH INNER JOIN SANPHAM ON CTHD.MaSP = SANPHAM.MaSP");
            rpTongDoanhThu RP = new rpTongDoanhThu();

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