private void loadCrystalRpt() { try { if (kiemtra()) { THANG = cbm_thang.Text; NAM = cbm_nam.Text; rpt_Nhanvienditre Rp = new rpt_Nhanvienditre(); DataTable ds = BUS.BUS_Bangcong.Nhanvienditre(cmbGio.Text, cmbPhut.Text, cbm_thang.Text, cbm_nam.Text); Rp.SetDataSource(ds); Rp.SetParameterValue("nam", Int32.Parse(NAM)); if (cbm_thang.Text == "----Chọn tháng----") { THANG = "0"; Rp.SetParameterValue("thang_nam", "NĂM " + NAM + " "); Rp.SetParameterValue("dau", ""); } else { Rp.SetParameterValue("thang_nam", "THÁNG " + THANG + " - " + NAM + " "); Rp.SetParameterValue("dau", " - "); } Rp.SetParameterValue("thang", Int32.Parse(THANG)); crystalReportViewer1.ReportSource = Rp; } } catch { MessageBox.Show("Kết nối với máy chủ thất bại", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_Nhanvienditre rpt = new rpt_Nhanvienditre(); rpt.Site = this.Site; return(rpt); }