-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use in browser - issue while opening generated excel #18
Comments
As a test, can you try renaming the file to something simpler? I've often found that some characters can confuse either Excel on open or confuse the browser when interpreting http headers on download. The other thing I notice is maybe it's a mismatch between |
Hi Pieter, thanks for collaboration.
I thought maybe this property mimeType is similar to bookType in SheetJS lib (XLSX through npm, where I was able to get it work with changing this booktype...), because I played with mimeType - tried to change it, but nothing happens. Maybe there is a way to convert it to old booktype with 'xls' somehow (maybe then it will work in my case)? |
Using your code from README.md - successfully generated workbook and got in running in dev(Thanks for this!) (locally, and in dev it works, however , after deployment to TEST env it downloaded and says me when I'm trying to open it: Excel could not be opened....because file format or file extension is not valid.
Difference in size: 2kb, 116 vs 118(valid)
I had same issue with XLSX library, that time I used different bookType - changed xlsx to xls - and it was fine ( XLSX.writeFile(workbook,
statements_export_${new Date().toUTCString()}.xls
, { bookType: 'xls' });Any suggestions for my case?
NOTwork.xlsx
works.xlsx
P.S: by the way interesting that both excels have content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet instead of that which we set in mimeType - application/vnd.ms-excel
The text was updated successfully, but these errors were encountered: