Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptKetHon rpt = new rptKetHon();

            rpt.Site = this.Site;
            return(rpt);
        }
Esempio n. 2
0
        public KetHon(string cmnd)
        {
            InitializeComponent();
            string        conStr = @"Data Source=DESKTOP-BV4LABJ\SQLEXPRESS;Initial Catalog=QuanLyDanCu;Persist Security Info=True;User ID=sa;Password=12345";
            SqlConnection conn   = new SqlConnection(conStr);

            string         sql     = $"select DonViQuanLis.Phuong as Phuong,DonViQuanLis.Quan as Quan,DonViQuanLis.ThanhPho as ThanhPho, GiayDangKyKetHons.MaGDKKetHon as So,MaQuyen,NgayDangKi,MaCD_Chong,Chong.HoLot+' '+Chong.Ten as TenChong,Chong.NgaySinh as NgaySinhChong,Chong.DanToc as DanTocChong,Chong.QuocTich as QuocTichChong,Chong.DiaChiThuongTru as DiaChiChong,Chong.soCMND as CMNDChong,Vo.HoLot+' '+Vo.Ten as TenVo,Vo.NgaySinh as NgaySinhVo,Vo.DanToc as DanTocVo,Vo.QuocTich as QuocTichVo,Vo.DiaChiThuongTru as DiaChiVo,Vo.soCMND as CMNDVo from DonViQuanLis, GiayDangKyKetHons inner join CongDans as Chong on GiayDangKyKetHons.MaCD_Chong = Chong.MaCD inner join CongDans as Vo on GiayDangKyKetHons.MaCD_Vo = Vo.MaCD where Chong.soCMND='{cmnd}' ";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);

            DataSetKetHon ketHon = new DataSetKetHon();

            adapter.Fill(ketHon.TblKetHon);

            rptKetHon report = new rptKetHon();

            report.SetDataSource(ketHon);

            rptviewKetHon.ReportSource = report;
        }