Async = true and output name



  • Hello,

    Using the API and setting options to:

    "options": { "reportName" : "myfile", "reports": { "async": true } }

    or

    "options": { "Content-Disposition": "attachment; filename=myfile.pdf", "reports": { "async": true } }

    doesn't set the filename. Is there something I'm doing wrong?



  • These options are used just to set the content-disposition header.
    It is not used in reports extension.

    I've submitted this as feature request.
    https://github.com/jsreport/jsreport/issues/458



  • I added this to reports.js and it will do what I need for the time being:

      	app.get('/reports/:id/attachment/:filename', function (req, res, next) {
    		serveReport(req, res).then(function (result) {
    			res.setHeader('Content-Disposition', 'attachment; filename="' + req.params.filename +'"')
    			result.stream.pipe(res)
    		}).catch(next)
    	})
    

Log in to reply
 

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