public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CryReportTraphong rpt = new CryReportTraphong(); rpt.Site = this.Site; return(rpt); }
private void btIn_Click(object sender, EventArgs e) { if (rdInAll.Checked == true) { string select = "select * from tbl_Traphongsv"; CryReportTraphong insv = new CryReportTraphong(); insv.SetDataSource(ketnoi.laydlbang(select)); crtInsv.ReportSource = insv; crtInsv.Refresh(); } else { if (rdInma.Checked == true) { string select = "select * from tbl_Traphongsv where Mssv='" + cbchon.Text + "'"; CryReportTraphong insv = new CryReportTraphong(); insv.SetDataSource(ketnoi.laydlbang(select)); crtInsv.ReportSource = insv; crtInsv.Refresh(); } else { if (rdPhong.Checked == true) { string select = "select * from tbl_Traphongsv where Mapsv='" + cbchon.Text + "'"; CryReportTraphong insv = new CryReportTraphong(); insv.SetDataSource(ketnoi.laydlbang(select)); crtInsv.ReportSource = insv; crtInsv.Refresh(); } else { if (rdtruong.Checked == true) { string select = "select * from tbl_Traphongsv where Matruong='" + cbchon.Text + "'"; CryReportTraphong insv = new CryReportTraphong(); insv.SetDataSource(ketnoi.laydlbang(select)); crtInsv.ReportSource = insv; crtInsv.Refresh(); } else { MessageBox.Show("Bạn phải chọn mục trước khi in!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } }