This commit is contained in:
2021-12-29 19:53:18 +00:00
parent 04062df1e1
commit ed62274b42
2 changed files with 8 additions and 25 deletions

View File

@@ -623,11 +623,7 @@ namespace AyaNova.Biz
if (!string.IsNullOrWhiteSpace(report.JsHelpers))
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsHelpers });
// if (!string.IsNullOrWhiteSpace(report.Style))
// await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style });
log.LogDebug($"Preparing page: adding Client meta data");
//Client meta data to JSON string
var clientMeta = reportRequest.ClientMeta.ToString();
@@ -668,9 +664,6 @@ namespace AyaNova.Biz
if (!ReportRenderManager.KeepGoing(job.GId))
return;
//#### DEBUGGING TOOL: view page contents
// var pagecontent = await page.GetContentAsync();
//prePareData / preRender
var ReportDataObject = $"{{ ayReportData:{ReportData}, ayReportMetaData:{reportMeta}, ayClientMetaData:{clientMeta}, ayServerMetaData:{serverMeta} }}";
@@ -691,17 +684,8 @@ namespace AyaNova.Biz
if (!ReportRenderManager.KeepGoing(job.GId))
return;
//render report as HTML
//add style
// if (!string.IsNullOrWhiteSpace(report.Style))
// {
// log.LogDebug($"Adding report template Style CSS");
// await page.AddStyleTagAsync(new AddTagOptions { Content = report.Style });
// }
// log.LogInformation(report.Style);
// log.LogInformation(compiledHTML);
log.LogDebug($"Setting page content to style and compiled HTML");
//render report as HTML
log.LogDebug($"Setting render page content style and compiled HTML");
await page.SetContentAsync($"<style>{report.Style}</style>{compiledHTML}");
@@ -722,7 +706,6 @@ namespace AyaNova.Biz
var ClientPDFTime = reportRequest.ClientMeta["PDFTime"].Value<string>();
PdfOptions.HeaderTemplate = report.HeaderTemplate.Replace("PDFDate", ClientPDFDate).Replace("PDFTime", ClientPDFTime);
PdfOptions.FooterTemplate = report.FooterTemplate.Replace("PDFDate", ClientPDFDate).Replace("PDFTime", ClientPDFTime);
}
if (report.PaperFormat != ReportPaperFormat.NotSet)
@@ -777,11 +760,7 @@ namespace AyaNova.Biz
if (!string.IsNullOrWhiteSpace(report.MarginOptionsTop))
PdfOptions.MarginOptions.Top = report.MarginOptionsTop;
//holding this back until figure it out
//it's not really a report property, but a print time / render property
//PdfOptions.PageRanges=report.PageRanges;
PdfOptions.PreferCSSPageSize = report.PreferCSSPageSize;
PdfOptions.PrintBackground = report.PrintBackground;
//Defaults to 1. Scale amount must be between 0.1 and 2.