Beispiel #1
0
        //Scott@2007-12-03 09:51 modified some of the following code.
        public void Add(ReportTemplateCollection i_Templates)
        {
            if (i_Templates == null)
            {
                return;
            }

            foreach (ReportTemplate i_Template in i_Templates)
            {
                this.InnerList.Add(i_Template);
            }
        }
Beispiel #2
0
        UI.ReportSelector _ReportSelectForm;        // = new Webb.Reports.ReportManager.UI.ReportSelector();
        public DialogResult ShowReportSelector(Form i_Owner, ReportTemplateCollection i_SelectedReports)
        {
            DialogResult m_Result = DialogResult.Cancel;

            if (this._ReportSelectForm == null)
            {
                this._ReportSelectForm = new Webb.Reports.ReportManager.UI.ReportSelector();
            }

            m_Result = this._ReportSelectForm.ShowDialog(i_Owner);

            if (m_Result == DialogResult.OK)
            {
                this._ReportSelectForm.GetSelectedReports(i_SelectedReports);
            }

            return(m_Result);
        }
Beispiel #3
0
        static ReportTemplateCollection LoadAllTemplates(string i_CatalogName)
        {
            RegistryKey m_RootKey = ReportTemplate.GetRootRegistry();

            string[] m_Catalogs = m_RootKey.GetSubKeyNames();
            //new collection
            ReportTemplateCollection m_TemplateCollection = new ReportTemplateCollection();

            foreach (string m_Catalog in m_Catalogs)
            {
                if ((i_CatalogName != m_Catalog) && (i_CatalogName != "All"))
                {
                    continue;
                }
                //
                RegistryKey m_SubKey    = m_RootKey.OpenSubKey(m_Catalog, true);
                string[]    m_Templates = m_SubKey.GetSubKeyNames();
                foreach (string m_TemplateName in m_Templates)
                {
                    RegistryKey m_TemplateKey = m_SubKey.OpenSubKey(m_TemplateName);
                    string[]    m_Names       = m_TemplateKey.GetValueNames();
                    if (!ReportTemplate.CheckInfoValid(m_Names, m_TemplateKey))
                    {
                        m_SubKey.DeleteSubKey(m_TemplateName, false);
                        continue;
                    }
                    ReportTemplate m_ReportTemplate = new ReportTemplate();
                    foreach (string m_Name in m_Names)
                    {
                        object m_value = m_TemplateKey.GetValue(m_Name);
                        m_ReportTemplate.SetValue(m_Name, m_value);
                    }
                    m_TemplateCollection.Add(m_ReportTemplate);
                }
            }
            return(m_TemplateCollection);
        }