Handlebars is not defined error during rendering report.
-
Hi Jsreport team!
I'm getting following error when I use "Handlebars.registerHelper("showMaster", function(index_count,block) {
if(parseInt(index_count)%3=== 0){
return block.fn(this);}
});"Please have a look
https://rajeev.jsreportonline.net/studio/templates/rJRv0HPReError occured - Error during rendering report: Handlebars is not defined
Stak - ReferenceError: Handlebars is not defined
at evalmachine.<anonymous>:1:2
at ContextifyScript.Script.runInContext (vm.js:32:29)
at ContextifyScript.Script.runInNewContext (vm.js:38:15)
at Object.runInNewContext (vm.js:91:38)
at module.exports (/usr/src/app/scripts/engineScript.js:150:10)
at IncomingMessage.<anonymous> (/usr/src/app/node_modules/script-manager/lib/worker-servers.js:160:57)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
From previous event:
at /usr/src/app/node_modules/jsreport-core/lib/render/render.js:144:54
at _fulfilled (/usr/src/app/node_modules/listener-collection/node_modules/q/q.js:794:54)
at self.promiseDispatch.done (/usr/src/app/node_modules/listener-collection/node_modules/q/q.js:823:30)
at Promise.promise.promiseDispatch (/usr/src/app/node_modules/listener-collection/node_modules/q/q.js:756:13)
at /usr/src/app/node_modules/listener-collection/node_modules/q/q.js:564:44
at flush (/usr/src/app/node_modules/listener-collection/node_modules/q/q.js:110:17)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)Please suggest how to make it working.
Thanks in Advance.
-
hi! you don't need to use the
Handlebars
object to be able to define helpers for your template.you just need to define a function in helpers section, just exactly as one of my examples where i defined a
eachKey
helper (https://playground.jsreport.net/studio/workspace/rkYn7WaCg/20)
-
Thanks
-
@RajeevK94037758 Please use markdown to highlight code in your questions https://help.github.com/articles/creating-and-highlighting-code-blocks/