public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { BaoCaoDanhSachHoSo rpt = new BaoCaoDanhSachHoSo(); rpt.Site = this.Site; return(rpt); }
private void button1_Click(object sender, EventArgs e) { using (SqlConnection cnn = new SqlConnection(constr)) { using (SqlCommand cmd = cnn.CreateCommand()) { cnn.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_thongKeHoSo"; // cmd.Parameters.AddWithValue("@id", cbbHso.SelectedValue); cmd.Parameters.AddWithValue("@ngayBatDau", DateTime.Parse(maskedTextBoxTuNgay.Text)); cmd.Parameters.AddWithValue("@ngayKetThuc", DateTime.Parse(maskedTextBoxDenNgay.Text)); SqlDataAdapter dap = new SqlDataAdapter(cmd); DataTable data = new DataTable(); dap.Fill(data); BaoCaoDanhSachHoSo report = new BaoCaoDanhSachHoSo(); report.SetDataSource(data); crystalReportViewer1.ReportSource = report; } } }