예제 #1
0
 private void Write(string csvFileNamePrefix)
 {
     Report(csvFileNamePrefix + "_alerts.csv", _report.GetAlertRows(TableReport.Row.SortRows_ByName));
     Report(csvFileNamePrefix + "_areas.csv", _report.GetAreaLabelRows(TableReport.Row.SortRows_ByName));
     Report(csvFileNamePrefix + "_teams.csv", _report.GetTeamAlertRows(TableReport.Row.SortRows_ByName));
     Report(csvFileNamePrefix + "_organizations.csv", _report.GetOrganizationAlertRows(TableReport.Row.SortRows_ByName));
 }
예제 #2
0
        private void Write(string outputHtmlFile, string reportName)
        {
            using (StreamWriter file = new StreamWriter(outputHtmlFile))
            {
                file.WriteLine("<html><body>");
                if (reportName != null)
                {
                    file.WriteLine($"<h2>Report: {reportName}</h2>");
                }
                file.WriteLine($"Report created on {DateTime.Now}<br/>");

                file.WriteLine("<h2>Alerts</h2>");
                Report(file, _report.GetAlertRows(TableReport.Row.SortRows_ByFirstColumn));

                file.WriteLine("<h2>Teams</h2>");
                Report(file, _report.GetTeamAlertRows(TableReport.Row.SortRows_ByFirstColumn));

                file.WriteLine("<h2>Organizations</h2>");
                Report(file, _report.GetOrganizationAlertRows(TableReport.Row.SortRows_ByFirstColumn));

                file.WriteLine("<h2>Alerts - alphabetically</h2>");
                Report(file, _report.GetAlertRows(TableReport.Row.SortRows_ByName));

                file.WriteLine("<h2>Areas - alphabetically</h2>");
                Report(file, _report.GetAreaLabelRows(TableReport.Row.SortRows_ByName));

                if (_report.BeginFiles != null)
                {
                    file.WriteLine("/begin");
                    file.WriteLine("<ul>");
                    foreach (string fileName in _report.BeginFiles)
                    {
                        file.WriteLine($"    <li>{fileName}</li>");
                    }
                    file.WriteLine("</ul>");
                }

                if (_report.MiddleFiles != null)
                {
                    file.WriteLine("/middle");
                    file.WriteLine("<ul>");
                    foreach (string fileName in _report.MiddleFiles)
                    {
                        file.WriteLine($"    <li>{fileName}</li>");
                    }
                    file.WriteLine("</ul>");
                }

                file.WriteLine("/end");
                file.WriteLine("<ul>");
                foreach (string fileName in _report.EndFiles)
                {
                    file.WriteLine($"    <li>{fileName}</li>");
                }
                file.WriteLine("</ul>");

                file.WriteLine("</body></html>");
            }
        }