コード例 #1
0
        public void HTMLReportsConfigurationConfigWindow()
        {
            EmailHtmlReportAttachment emailAttachment;

            if (runSetActionHTMLReportSendEmail.EmailAttachments.Where(x => x.AttachmentType == EmailAttachment.eAttachmentType.Report).ToList().Count < 1)
            {
                emailAttachment = new EmailHtmlReportAttachment {
                    ZipIt = true, SelectedHTMLReportTemplateID = 1
                };
                runSetActionHTMLReportSendEmail.EmailAttachments.Add(emailAttachment);
                HTMLReportAttachmentConfigurationPage pg = new HTMLReportAttachmentConfigurationPage(emailAttachment);
                pg.ShowAsWindow();
            }
            else if (AttachmentsGrid.CurrentItem != null)
            {
                if (AttachmentsGrid.CurrentItem.GetType() == typeof(EmailHtmlReportAttachment))
                {
                    emailAttachment = ((EmailHtmlReportAttachment)AttachmentsGrid.CurrentItem);
                    if (emailAttachment != null)
                    {
                        HTMLReportAttachmentConfigurationPage pg = new HTMLReportAttachmentConfigurationPage(emailAttachment);
                        pg.ShowAsWindow();
                    }
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
            }
        }
コード例 #2
0
        public void HTMLReportAttachment(string extraInformationCalculated, ref string emailReadyHtml, ref string reportsResultFolder, string runSetFolder, object Report, object conf)
        {
            EmailHtmlReportAttachment rReport     = (EmailHtmlReportAttachment)Report;
            HTMLReportsConfiguration  currentConf = (HTMLReportsConfiguration)conf;

            if (!HTMLReportAttachmentConfigurationPage.HasWritePermission(extraInformationCalculated))
            {
                emailReadyHtml = emailReadyHtml.Replace("<!--WARNING-->",
                                                        "<b>Full report attachment failed, </b>" +
                                                        "Error: User '" + WindowsIdentity.GetCurrent().Name.ToString() + "' have no write permission on provided alternative folder - " + extraInformationCalculated + ". Attachment in it not saved.");
            }
            else
            {
                emailReadyHtml = emailReadyHtml.Replace("<!--WARNING-->", "");
                ObservableList <HTMLReportConfiguration> HTMLReportConfigurations = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <HTMLReportConfiguration>();
                reportsResultFolder = Ginger.Reports.GingerExecutionReport.ExtensionMethods.CreateGingerExecutionReport(new ReportInfo(runSetFolder),
                                                                                                                        false,
                                                                                                                        HTMLReportConfigurations.Where(x => (x.ID == rReport.SelectedHTMLReportTemplateID)).FirstOrDefault(),
                                                                                                                        extraInformationCalculated + "\\" + System.IO.Path.GetFileName(runSetFolder), false, currentConf.HTMLReportConfigurationMaximalFolderSize);
            }
        }