This commit is contained in:
2020-09-07 22:41:56 +00:00
parent 6f42a1f801
commit 70bf9fa51c
3 changed files with 17 additions and 2 deletions

View File

@@ -409,7 +409,7 @@ namespace AyaNova.Biz
#endif
//compile and run handlebars template
var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta}, ayApiUrl:`{apiUrl}` }});";
var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta}, ayServerMetaData:{{ayApiUrl:`{apiUrl}`}} }});";
var resultHTML = await page.EvaluateExpressionAsync<string>(compileScript);
//render report as HTML

View File

@@ -19,7 +19,7 @@ function ayRegisterHelpers() {
});
Handlebars.registerHelper("ayLogo", function (size) {
var url = `${Handlebars.escapeExpression(this.ayApiUrl)}logo/${size}`;
var url = `${Handlebars.escapeExpression(this.ayServerMetaData.ayApiUrl)}logo/${size}`;
return new Handlebars.SafeString("<img src='" + url + "'/>");
});