Beispiel #1
0
        private void frmHoaDonBanHang_Load(object sender, EventArgs e)
        {
            ReportDocument rp = new ReportDocument();

            rp.Load(@"C:\Users\Ron\Desktop\Tốt Nghiệp\CHTapHoa\CHTapHoa\Reports\HoaDonBanHang.rpt");

            List <HoaDonXuatDTO> dsHDX = new List <HoaDonXuatDTO>();
            HoaDonXuatDTO        hdx   = _hdxBus.LayHDTheoMa(MaHD);

            dsHDX.Add(hdx);

            rp.SetDataSource(dsHDX);

            List <CTHDXuatDTO> dsSanPham = _cthdxBus.DanhSachChiTietHoaDonXuat(MaHD);

            rp.Subreports[0].SetDataSource(dsSanPham);

            crystalReportViewer1.ReportSource = rp;
            this.crystalReportViewer1.Show();
            this.crystalReportViewer1.Refresh();
        }