public object CreateNewReportTemplate() { ReportTemplate NewReportTemplate = new ReportTemplate() { Name = "New Report Template", Status = ReportTemplate.eReportStatus.Development }; ReportTemplateSelector RTS = new ReportTemplateSelector(); RTS.ShowAsWindow(); if (RTS.SelectedReportTemplate != null) { NewReportTemplate.Xaml = RTS.SelectedReportTemplate.Xaml; //Make it Generic or Const string for names used for File string NewReportName = string.Empty; if (GingerCore.General.GetInputWithValidation("Add Report Template", "Report Template Name:", ref NewReportName, System.IO.Path.GetInvalidFileNameChars())) { NewReportTemplate.Name = NewReportName; WorkSpace.Instance.SolutionRepository.AddRepositoryItem(NewReportTemplate); } return(NewReportTemplate); } return(null); }
private void SelectTemplateButton_Click(object sender, RoutedEventArgs e) { ReportTemplateSelector RTS = new ReportTemplateSelector(); RTS.ShowAsWindow(); if (RTS.SelectedReportTemplate != null) { TemplateNameTextBox.Text = RTS.SelectedReportTemplate.Name; } }
private void SetDefaultTemplate(object sender, System.Windows.RoutedEventArgs e) { ReportTemplateSelector RTS = new ReportTemplateSelector(); RTS.ShowAsWindow(); if (RTS.SelectedReportTemplate != null) { App.UserProfile.ReportTemplateName = RTS.SelectedReportTemplate.Name; } }
private void AddReport(object sender, RoutedEventArgs e) { ReportTemplateSelector RTS = new ReportTemplateSelector(); RTS.ShowAsWindow(); if (RTS.SelectedReportTemplate != null) { runSetActionHTMLReportSendEmail.EmailAttachments.Add(new EmailAttachment() { Name = RTS.SelectedReportTemplate.Name, AttachmentType = EmailAttachment.eAttachmentType.Report }); } }
internal ReportTemplate CreateNewReportTemplate(string path = "") { ReportTemplate NewReportTemplate = new ReportTemplate() { Name = "New Report Template", Status = ReportTemplate.eReportStatus.Development }; System.Reflection.Assembly ExecutingAssembly; ExecutingAssembly = System.Reflection.Assembly.GetExecutingAssembly(); ReportTemplateSelector RTS = new ReportTemplateSelector(); RTS.ShowAsWindow(); if (RTS.SelectedReportTemplate != null) { NewReportTemplate.Xaml = RTS.SelectedReportTemplate.Xaml; //Make it Generic or Const string for names used for File string NewReportName = string.Empty; if (GingerCore.General.GetInputWithValidation("Add Report Template", "Report Template 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); }