Пример #1
0
 public ManageReportTemplate(int viewid)
 {
     InitializeComponent();
     BPContext = new BrightPlatformEntities(UserSession.EntityConnection);
     reportDesign = new ReportUserDesigner();
     //BindSubcampaignLookup();
 }
Пример #2
0
 private void btnCreateTemplate_Click(object sender, EventArgs e)
 {
     if (HasSelectedCampaign)
     {
         reportDesign = new ReportUserDesigner();
         reportDesign.SaveReport += new SaveReportEventHandler(reportDesign_SaveReport);
         reportDesign.ChangeReportName += new ChangeNameEventHandler(reportDesign_ChangeReportName);
         reportDesign.ShowDialog();
     }
 }
Пример #3
0
 private void _oReport_AfterSave(object sender, ReportUserDesigner.AfterSaveArgs e)
 {
     gvReportTemplate.SetRowCellValue(gvReportTemplate.FocusedRowHandle, "layout_config", e.efAdditionalDataReportTemplate.layout_config);
     m_oReport.AfterSave -= new ReportUserDesigner.AfterSaveEventHandler(_oReport_AfterSave);
 }
Пример #4
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();
        }
Пример #5
0
        private void m_oReport_AfterSave(object sender, ReportUserDesigner.AfterSaveArgs e)
        {
            if (m_oReport.ModuleType == ReportUserDesigner.eModuleType.ReportTemplate) {
                gvReportTemplate.SetRowCellValue(gvReportTemplate.FocusedRowHandle, "layout_config", e.efAdditionalDataReportTemplate.layout_config);
                if (!string.IsNullOrEmpty(e.efAdditionalDataReportTemplate.layout_config))
                    gvReportTemplate.SetRowCellValue(gvReportTemplate.FocusedRowHandle, "has_layout", true);
            }

            else if (m_oReport.ModuleType == ReportUserDesigner.eModuleType.ViewConfiguration) {
                if (!string.IsNullOrEmpty(e.efViewConfiguration.report_layout_config)) {
                    m_ConfigLayout.Complete = true;
                    tbpgeLayoutConfig.Image = ManagerApplication.Properties.Resources.save_ok;
                    btnEditReportTemplate.Image = ManagerApplication.Properties.Resources.view_config_completed;
                    m_efoViewConfig.report_layout_config = e.efViewConfiguration.report_layout_config;
                    m_efDbContext.view_configuration.ApplyCurrentValues(m_efoViewConfig);
                    m_efDbContext.SaveChanges();
                }
            }

            m_oReport.AfterSave -= new ReportUserDesigner.AfterSaveEventHandler(m_oReport_AfterSave);
        }
Пример #6
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();
            }
        }