jsreport recipe which renders excel reports based on uploaded excel templates by modifying the xlsx source using predefined templating engine helpers
See the docs https://jsreport.net/learn/xlsx
npm install jsreport-xlsx
var fs = require('fs')
var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-xlsx')())
jsreport.use(require('jsreport-handlebars')())
jsreport.init().then(function () {
return jsreport.render({
template: {
recipe: 'xlsx',
engine: 'handlebars',
content: '{{{xlsxPrint}}}',
xlsxTemplate: {
content: fs.readFileSync('Book1.xlsx').toString('base64')
}
}
}).then(function (report) {
report.stream.pipe(fs.createWriteStream('out.xlsx'))
})
})