Reputation: 526
I am trying to save the response received from jsreport API. How to save jsreport response to an excel file?
Upvotes: 1
Views: 383
Reputation: 51
I am assuming you have a little knowledge of JSReport.
First of all, make sure that you set up your report to run as an excel report and that you have xlsx
selected in the template type.
I assume you've already done all of that.
Next, in the JSON object that you send to JSReport, you will probably have created something like this:
let dataOptions = {
template: {
shortid: 'xx2346kn'
},
data: reportData
}
Add an options
property so that you end up with this:
let dataOptions = {
template: {
shortid: 'xx2346kn'
},
data: reportData,
options: {
preview: true
}
}
Assuming you've set everything else up correctly, this will
save jsreport response to an excel file
in your default downloads location.
Upvotes: 0