Example #1
0
        internal HTMLReportTemplate CreateNewHTMLReportTemplate(string path = "")
        {
            //TODO: change to wizard
            HTMLReportTemplate NewReportTemplate = new HTMLReportTemplate()
            {
                Name = "New Report Template", Status = HTMLReportTemplate.eReportStatus.Development
            };

            HTMLReportTemplateSelector RTS = new HTMLReportTemplateSelector();

            RTS.ShowAsWindow();

            if (RTS.SelectedReportTemplate != null)
            {
                NewReportTemplate.HTML = RTS.SelectedReportTemplate.HTML;

                //Make it Generic or Const string for names used for File
                string NewReportName = string.Empty;
                if (GingerCore.General.GetInputWithValidation("Add New Report", "Report Name:", ref NewReportName))
                {
                    NewReportTemplate.Name = NewReportName;
                    WorkSpace.Instance.SolutionRepository.AddRepositoryItem(NewReportTemplate);
                }
                return(NewReportTemplate);
            }
            return(null);
        }
Example #2
0
        internal HTMLReportTemplate CreateNewHTMLReportTemplate(string path = "")
        {
            HTMLReportTemplate NewReportTemplate = new HTMLReportTemplate()
            {
                Name = "New Report Template", Status = HTMLReportTemplate.eReportStatus.Development
            };

            System.Reflection.Assembly ExecutingAssembly;
            ExecutingAssembly = System.Reflection.Assembly.GetExecutingAssembly();

            HTMLReportTemplateSelector RTS = new HTMLReportTemplateSelector();

            RTS.ShowAsWindow();

            if (RTS.SelectedReportTemplate != null)
            {
                NewReportTemplate.HTML = RTS.SelectedReportTemplate.HTML;

                //Make it Generic or Const string for names used for File
                string NewReportName = string.Empty;
                if (GingerCore.General.GetInputWithValidation("Add New Report", "Report Name:", ref NewReportName, System.IO.Path.GetInvalidFileNameChars()))
                {
                    NewReportTemplate.Name = NewReportName;
                    if (string.IsNullOrEmpty(path))
                    {
                        NewReportTemplate.FileName = LocalRepository.GetRepoItemFileName(NewReportTemplate);
                    }
                    else
                    {
                        NewReportTemplate.FileName = LocalRepository.GetRepoItemFileName(NewReportTemplate, path);
                    }
                    if (App.LocalRepository != null)
                    {
                        App.LocalRepository.SaveNewItem(NewReportTemplate, path);
                        App.LocalRepository.AddItemToCache(NewReportTemplate);
                    }
                }
                return(NewReportTemplate);
            }
            return(null);
        }