Пример #1
0
        public void SetBodyFromHTMLReport(ReportInfo RI)
        {
            HTMLReportBase HRB = null;

            switch (RunSetActionSendEmail.HTMLReportTemplate)
            {
            case eHTMLReportTemplate.Detailed:
                HRB = new HTMLDetailedReport();
                break;

            case eHTMLReportTemplate.Summary:
                HRB = new HTMLSummaryReport();
                break;

            case eHTMLReportTemplate.Plain:
                HRB = new HTMLPlainReport();
                break;

            case eHTMLReportTemplate.Custom:

                string html = String.Empty;

                HTMLReportTemplate HTMLR = new HTMLReportTemplate();
                ObservableList <HTMLReportTemplate> HTMLReports = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <HTMLReportTemplate>();
                foreach (HTMLReportTemplate HT in HTMLReports)
                {
                    if (HT.Name == RunSetActionSendEmail.CustomHTMLReportTemplate)
                    {
                        html  = HT.HTML;
                        HTMLR = HT;
                    }
                }

                //HTMLReportPage HTP = new HTMLReportPage(RI, html);

                //Email.Body = HTP.HTML;

                return;

            // break;
            default:
                //not implemented
                break;
            }

            if (HRB != null)
            {
                RunSetActionSendEmail.Email.Body = HRB.CreateReport(RI);
                RunSetActionSendEmail.CustomHTMLReportTemplate = String.Empty;
            }
            else
            {
                throw new Exception("Unknown HTML Report type - " + RunSetActionSendEmail.HTMLReportTemplate.ToString());
            }
        }
Пример #2
0
        public void SetBodyFromHTMLReport(ReportInfo RI)
        {
            HTMLReportBase HRB = null;

            switch (HTMLReportTemplate)
            {
            case eHTMLReportTemplate.Detailed:
                HRB = new HTMLDetailedReport();
                break;

            case eHTMLReportTemplate.Summary:
                HRB = new HTMLSummaryReport();
                break;

            case eHTMLReportTemplate.Plain:
                HRB = new HTMLPlainReport();
                break;

            case eHTMLReportTemplate.Custom:

                string html = String.Empty;

                HTMLReportTemplate HTMLR = new HTMLReportTemplate();
                foreach (HTMLReportTemplate HT in App.LocalRepository.GetSolutionHTMLReportTemplates())
                {
                    if (HT.Name == CustomHTMLReportTemplate)
                    {
                        html  = HT.HTML;
                        HTMLR = HT;
                    }
                }

                HTMLReportPage HTP = new HTMLReportPage(RI, html);

                Email.Body = HTP.HTML;

                return;
                // break;
            }

            if (HRB != null)
            {
                Email.Body = HRB.CreateReport(RI);
                CustomHTMLReportTemplate = String.Empty;
            }
            else
            {
                throw new Exception("Unknown HTML Report type - " + HTMLReportTemplate.ToString());
            }
        }