Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CryReportHoatDong rpt = new CryReportHoatDong();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
 private void btIn_Click(object sender, EventArgs e)
 {
     if (rdInAll.Checked == true)
     {
         string            select = "SELECT * FROM dbo.tbl_NhanVien INNER JOIN dbo.tbl_HoatDong ON dbo.tbl_NhanVien.Manv = dbo.tbl_HoatDong.Manv";
         CryReportHoatDong inhd   = new CryReportHoatDong();
         inhd.SetDataSource(ketnoi.laydlbang(select));
         crtInhdong.ReportSource = inhd;
         crtInhdong.Refresh();
     }
     else
     {
         if (rdHdong.Checked == true)
         {
             string            select = "SELECT * FROM dbo.tbl_NhanVien INNER JOIN dbo.tbl_HoatDong ON dbo.tbl_NhanVien.Manv = dbo.tbl_HoatDong.Manv where Mahdong='" + cbchon.SelectedValue.ToString() + "'";
             CryReportHoatDong inhd   = new CryReportHoatDong();
             inhd.SetDataSource(ketnoi.laydlbang(select));
             crtInhdong.ReportSource = inhd;
             crtInhdong.Refresh();
         }
         else
         {
             if (rdInnv.Checked == true)
             {
                 string            select = "select * FROM dbo.tbl_NhanVien INNER JOIN dbo.tbl_HoatDong ON dbo.tbl_NhanVien.Manv = dbo.tbl_HoatDong.Manv where dbo.tbl_HoatDong.Manv='" + cbchon.SelectedValue.ToString() + "'";
                 CryReportHoatDong inhd   = new CryReportHoatDong();
                 inhd.SetDataSource(ketnoi.laydlbang(select));
                 crtInhdong.ReportSource = inhd;
                 crtInhdong.Refresh();
             }
             else
             {
                 MessageBox.Show("Bạn phải chọn mục để in", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }