Exceljs



  • Hello, how can I setup the exceljs library in jsreport to generate Excel reports?



  • You can use it through jsreport scripts(hooks)
    https://jsreport.net/learn/scripts

    Something like this in pseudocode. You just overwrite the result of the template with your own produced with a library.

    const xlsxjs = require('xlsjs')
    async function afterRender(req, res) {
        const xlsxBuffer = await xlsjs.createSomeStuff()
        res.content = xlsxBuffer
        res.meta.contentType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
    }
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.