This commit is contained in:
2020-09-08 15:42:56 +00:00
parent e3089a2b2c
commit f04a8124ae
4 changed files with 27 additions and 17 deletions

View File

@@ -400,7 +400,10 @@ namespace AyaNova.Biz
var clientMeta = "{}";
if (reportParam.ClientMeta != null)
clientMeta = reportParam.ClientMeta.ToString();
// await page.AddScriptTagAsync(new AddTagOptions() { Content = $"var ayClientMetaData = {clientMeta}" });
//add Server meta data
var serverMeta=$"{{ayApiUrl:`{apiUrl}`}}";
//this is how you view the contents of the page
#if (DEBUG)
@@ -408,8 +411,8 @@ namespace AyaNova.Biz
#endif
//compile and run handlebars template
var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta}, ayServerMetaData:{{ayApiUrl:`{apiUrl}`}} }});";
//var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta}, ayServerMetaData:{{ayApiUrl:`{apiUrl}`}} }});";
var compileScript = $"Handlebars.compile(`{report.Template}`)(ayPreRender({{ ayReportData:{ReportData}, ayClientMetaData:{clientMeta}, ayServerMetaData:{serverMeta} }}));";
var resultHTML = await page.EvaluateExpressionAsync<string>(compileScript);
//render report as HTML