jsreport / jsreport-xlsx

jsreport recipe rendering excels directly from open xml
https://jsreport.net/learn/xlsx
MIT License
8 stars 8 forks source link

⚠️ This repository has been moved to the monorepo jsreport/jsreport

jsreport-xlsx

NPM Version Build Status

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

Installation

npm install jsreport-xlsx

jsreport-core

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'))
  })
})