public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpThongKe rpt = new rpThongKe(); rpt.Site = this.Site; return(rpt); }
private void btnthongke_Click(object sender, EventArgs e) { if (cbbKhoa.SelectedValue == null || cbbLop.SelectedValue == null) { return; } string maKhoa = cbbKhoa.SelectedValue.ToString(); string maLop = cbbLop.SelectedValue.ToString(); rpThongKe rpObj = new rpThongKe(); dsSinhVien dsSinhVien = new dsSinhVien(); DataTable dtSV = dsSinhVien.dtSinhVien; sinhVienBUS.FillDataTable(ref dtSV, maLop); dsSinhVien.AcceptChanges(); rpObj.SetDataSource(dsSinhVien); CrystalDecisions.CrystalReports.Engine.TextObject textObj; textObj = (CrystalDecisions.CrystalReports.Engine.TextObject)rpObj.ReportDefinition.ReportObjects["txtKhoa"]; textObj.Text = maKhoa; textObj = (CrystalDecisions.CrystalReports.Engine.TextObject)rpObj.ReportDefinition.ReportObjects["txtLop"]; textObj.Text = maLop; crystalReportViewer1.ReportSource = rpObj; }