Example #1
0
        public static async Task AllEventsHtmlReport()
        {
            var log = await Db.Log();

            var htmlTable = log.EventLogs.Take(5000).OrderByDescending(x => x.RecordedOn).ToList()
                            .ToHtmlTable(new { @class = "pure-table pure-table-striped" });

            await ThreadSwitcher.ResumeForegroundAsync();

            var reportWindow = new HtmlViewerWindow(htmlTable.ToHtmlDocumentWithPureCss("Events Report", string.Empty));

            reportWindow.Show();
        }
Example #2
0
        public static async Task GenerationListHtmlReport(List <GenerationReturn> generationReturns, string title,
                                                          string intro)
        {
            var bodyBuilder = new StringBuilder();

            bodyBuilder.AppendLine($"<p>{HttpUtility.HtmlEncode(intro)}</p>");
            bodyBuilder.AppendLine(generationReturns.ToHtmlTable(new { @class = "pure-table pure-table-striped" }));

            await ThreadSwitcher.ResumeForegroundAsync();

            var reportWindow =
                new HtmlViewerWindow(bodyBuilder.ToString().ToHtmlDocumentWithPureCss(title, string.Empty));

            reportWindow.Show();
        }
Example #3
0
        public static async Task ExceptionEventsHtmlReport()
        {
            await ThreadSwitcher.ResumeBackgroundAsync();

            var log = await Db.Log();

            var htmlTable = log.EventLogs.Where(x => x.Category == "Exception" || x.Category == "Startup").Take(1000)
                            .OrderByDescending(x => x.RecordedOn).ToList()
                            .ToHtmlTable(new { @class = "pure-table pure-table-striped" });

            await ThreadSwitcher.ResumeForegroundAsync();

            var reportWindow =
                new HtmlViewerWindow(htmlTable.ToHtmlDocumentWithPureCss("Exception Events Report", string.Empty));

            reportWindow.Show();
        }