Rendering shortcut not working
-
Hello, I have a use case where we need to render reports using the rendering shortcut as described here https://jsreport.net/learn/adapting-jsreport#using-rendering-shortcut
However, when trying to run this, i get the error: "Error: Not initialized, you need to call jsreport.init().then before rendering".
It is calling the init() function which we are trying to avoid.The code looks as follows:
const jsreport = require('jsreport'); ... const out = await jsreport.render({ template: { shortid: 'q~xVpyT', engine: 'handlebars', recipe: 'chrome-pdf' }, data: { ...data }, options: { language: languageCode } });
If anybody could point out what I'm doing wrong here I'd very much appreciate it!
-
I'm not able to replicate this. I tried this code:
const jsreport = require('jsreport'); async function run() { const out = await jsreport.render({ template: { content: 'hello', engine: 'handlebars', recipe: 'chrome-pdf' } }); } run().then(() => console.log('done')).catch(console.error);