示例#1
0
        private void btnTaoBaoCao_Click(object sender, EventArgs e)
        {
            frmReport frm = new frmReport();

            List <ReportParameter> _params = new List <ReportParameter>()
            {
                new ReportParameter("CenterName", GlobalSettings.CenterName),
                new ReportParameter("CenterWebsite", GlobalSettings.CenterWebsite),
                new ReportParameter("TongCong", gridBaoCao.Rows.Count.ToString()),
                new ReportParameter("TongNo", TongNo().ToString())
            };

            frm.ReportViewer.LocalReport.ReportEmbeddedResource = "QuanLyHocVien.Reports.rptBaoCaoHocVienNo.rdlc";

            dsSource.dtBaoCaoNoHocVienDataTable dt = new dsSource.dtBaoCaoNoHocVienDataTable();
            var query = PhieuGhiDanh.ThongKeDanhSachNoHocPhi();

            foreach (var i in query)
            {
                dt.Rows.Add(i.MaHV, i.TenHV, i.GioiTinhHV, i.TenKH, i.ConNo);
            }

            frm.ReportViewer.LocalReport.DataSources.Clear();
            frm.ReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ds", (DataTable)dt));

            frm.ReportViewer.LocalReport.SetParameters(_params);
            frm.ReportViewer.LocalReport.DisplayName = "Thống kê học viên nợ học phí";
            frm.Text = "Thống kê học viên nợ học phí";

            frm.ShowDialog();
        }
示例#2
0
        private void frmThongKeNoHocVien_Load(object sender, EventArgs e)
        {
            gridBaoCao.AutoGenerateColumns = false;

            Thread th = new Thread(() =>
            {
                object source = PhieuGhiDanh.ThongKeDanhSachNoHocPhi();

                gridBaoCao.Invoke((MethodInvoker) delegate
                {
                    gridBaoCao.DataSource = source;
                });
            });

            th.Start();
        }