This commit is contained in:
2020-09-07 20:47:23 +00:00
parent 9d25ef3da4
commit b4345a5b74
2 changed files with 10 additions and 1 deletions

View File

@@ -69,6 +69,8 @@ namespace AyaNova.Biz
return null;
}
Report newObject = new Report();
CopyObject.Copy(dbObject, newObject);
string newUniqueName = string.Empty;
bool NotUnique = true;
long l = 1;
@@ -407,7 +409,7 @@ namespace AyaNova.Biz
#endif
//compile and run handlebars template
var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta} }});";
var compileScript = $"Handlebars.compile(`{report.Template}`)({{ ayReportData:ayPreRender({ReportData}), ayClientMetaData:{clientMeta}, ayApiUrl:{apiUrl} }});";
var resultHTML = await page.EvaluateExpressionAsync<string>(compileScript);
//render report as HTML

View File

@@ -10,6 +10,13 @@ function ayRegisterHelpers() {
Handlebars.registerHelper("ayJSON", function (obj) {
return JSON.stringify(obj, null, 3);
});
Handlebars.registerHelper("link", function(text, url) {
var url = Handlebars.escapeExpression(url),
text = Handlebars.escapeExpression(text)
return new Handlebars.SafeString("<a href='" + url + "'>" + text +"</a>");
});
}
function ayPreRender(theReportData) {