This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user