示例#1
0
        private void btnEditReportDesigner_Click(object sender, EventArgs e)
        {
            if (gvReportTemplate.RowCount < 1)
                return;

            WaitDialog.Show("Loading report designer.");
            CTAdditionalDataReportTemplate _item = gvReportTemplate.GetFocusedRow() as CTAdditionalDataReportTemplate;
            if (string.IsNullOrEmpty(_item.layout_config)) {
                m_oReport = new ReportUserDesigner(true);
                m_oReport.AfterSave += new ReportUserDesigner.AfterSaveEventHandler(_oReport_AfterSave);
                m_oReport.ModuleType = ReportUserDesigner.eModuleType.ReportTemplate;
                m_oReport.ReportTemplateId = _item.id;
                m_oReport.Show();
            }
            else {
                m_oReport = new ReportUserDesigner(_item.layout_config);
                m_oReport.AfterSave += new ReportUserDesigner.AfterSaveEventHandler(_oReport_AfterSave);
                m_oReport.ModuleType = ReportUserDesigner.eModuleType.ReportTemplate;
                m_oReport.ReportTemplateId = _item.id;
                m_oReport.ShowReportDesigner();
            }
            WaitDialog.Close();
        }
示例#2
0
        private void btnEditReportTemplate_Click(object sender, EventArgs e)
        {
            WaitDialog.Show("Loading designer ...");
            view_configuration _item;
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                _item = _efDbContext.view_configuration.FirstOrDefault(i => i.id == m_efoViewConfig.id);
                _efDbContext.Detach(_item);
            }

            if (_item == null || string.IsNullOrEmpty(_item.report_layout_config)) {
                WaitDialog.Close();
                MessageBox.Show("This report has no layout template yet. Please kindly set a layout first.", "Bright Sales", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else {
                m_oReport = new ReportUserDesigner(_item.report_layout_config) {
                    ModuleType = ReportUserDesigner.eModuleType.ViewConfiguration,
                    ViewConfigId = m_efoViewConfig.id,
                    Text = "Edit Report Template"
                };
                m_oReport.AfterSave += new ReportUserDesigner.AfterSaveEventHandler(m_oReport_AfterSave);
                WaitDialog.Close();
                m_oReport.ShowReportDesigner();
            }
        }