private void btnThongKeTheoThang_Click(object sender, EventArgs e) { try { SqlParameter prThang = new SqlParameter("@THANG", SqlDbType.Int); prThang.Value = cobThang.SelectedValue; SqlParameter prNam = new SqlParameter("@NAM", SqlDbType.Int); prNam.Value = txtNam.Text; SqlParameter[] pr = { prThang, prNam }; clearAllERP(); kiemTraLoi(); rpvThongKeTienDien.ProcessingMode = ProcessingMode.Local; rpvThongKeTienDien.LocalReport.ReportPath = "GUI/Report1.rdlc"; ReportDataSource rds = new ReportDataSource(); rds.Name = "dsThongKeTienDien"; rds.Value = xuLyDuLieu.bangDuLieuDS("psThongKeTienDien", pr).Tables[0]; rpvThongKeTienDien.LocalReport.DataSources.Clear(); rpvThongKeTienDien.LocalReport.DataSources.Add(rds); rpvThongKeTienDien.RefreshReport(); } catch (Exception ex) { MessageBox.Show("Vui lòng nhập năm!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnThongKe_Click(object sender, EventArgs e) { SqlParameter prTrangThai = new SqlParameter("@TRANGTHAI", SqlDbType.NVarChar, 30); prTrangThai.Value = cobTrangThai.SelectedValue; SqlParameter[] pr = { prTrangThai }; rpvThongKeCanHo.ProcessingMode = ProcessingMode.Local; rpvThongKeCanHo.LocalReport.ReportPath = "GUI/Report4.rdlc"; ReportDataSource rds = new ReportDataSource(); rds.Name = "dsThongKeCanHo"; rds.Value = xuLyDuLieu.bangDuLieuDS("psThongKeCanHo", pr).Tables[0]; rpvThongKeCanHo.LocalReport.DataSources.Clear(); rpvThongKeCanHo.LocalReport.DataSources.Add(rds); rpvThongKeCanHo.RefreshReport(); }