Open sandysh opened 4 years ago
workbook.writeToBuffer().then((buffer) => {
const binaryBuffer = Buffer.from(buffer);
res.attachment('Spreadsheet.xlsx');
return res.send(binaryBuffer);
});
hello, I tried this solution but I didn't get the download message on the cllient. what could I be missing? I am using angularjs. This is the call to the server:
$scope.createReport = function(){ $http.post('/export/createHoursReport?'+ $.param({campaign : campaign_id, date : $('#date').val(), type: 'hours'})) .success(function(data) { console.log(data); }) }
I am guessing I am missing how to process the file. Can someone help me?
tried processing it as blob data, but the file in result is corrupted. What could I be missing?
var blob = new Blob([data], { type: "octet/stream" }); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = 'filename.xlsx'; document.body.appendChild(link); link.click(); document.body.removeChild(link);
tried processing it as blob data, but the file in result is corrupted. What could I be missing?
var blob = new Blob([data], { type: "octet/stream" }); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = 'filename.xlsx'; document.body.appendChild(link); link.click(); document.body.removeChild(link);
Did you figure out? In postman I can save response, but unable to do it on client side of browser
Hello Team, thank you for the awesome package you have created. I have only one query regarding this package and that is if there is a way to force open a save dialog in browser instead of saving excel file directly in current working directory. The scenario is that i want user to choose location to where they want to download the excel file.