Esempio n. 1
0
        private void simpleButtonXuatBD_Click(object sender, EventArgs e)
        {
            if (_dsBaocaoTongKetMonHoc.Count == 0)
            {
                MsgboxUtil.Error("Không tồn tại lớp để thực hiện báo cáo!");
                return;
            }
            if (_rptTongKetMon == null)
            {
                _rptTongKetMon = new rptTongKetMon();
            }
            _rptTongKetMon.SetDataSource(_dsBaocaoTongKetMonHoc);
            // Set parameter
            _rptTongKetMon.SetParameterValue("paramTenMonHoc",
                                             treeMonHoc.FocusedNode.GetValue("TenMonHoc").ToString().ToUpper());
            _rptTongKetMon.SetParameterValue("paramTenNamHoc",
                                             CboUtil.GetDisplayItem(comboBoxEditNamHoc));
            _rptTongKetMon.SetParameterValue("paramMaHocKy",
                                             CboUtil.GetValueItem(comboBoxEditHocKy));
            _rptTongKetMon.SetParameterValue("paramMaKhoi",
                                             CboUtil.GetValueItem(comboBoxEditKhoiLop));

            if (_frmReportViewTongKetMon == null || _frmReportViewTongKetMon.IsDisposed)
            {
                _frmReportViewTongKetMon = new frmReportView();
            }
            _frmReportViewTongKetMon.crystalReportViewer.ReportSource = _rptTongKetMon;
            _frmReportViewTongKetMon.ShowDialog();
        }
        private void simpleButtonXuatBD_Click(object sender, EventArgs e)
        {
            if (_rptTongKetHocKy == null)
            {
                _rptTongKetHocKy = new rptBangDiemHocKy();
            }
            if (_frmReportView == null || _frmReportView.IsDisposed)
            {
                _frmReportView = new frmReportView();
            }
            _rptTongKetHocKy.SetDataSource(_bangDiemHocKyDTO);
            // Set parameter
            _rptTongKetHocKy.SetParameterValue("paramTenNam", labelControlNamHoc.Text);
            _rptTongKetHocKy.SetParameterValue("paramHocKy", labelControlHocKy.Text);
            _rptTongKetHocKy.SetParameterValue("paramGVCN", labelControlGVCN.Text);
            _rptTongKetHocKy.SetParameterValue("paramTenLop", labelControlLop.Text);


            _frmReportView.crystalReportViewer.ReportSource = _rptTongKetHocKy;
            _frmReportView.ShowDialog();
        }