stephen-hardy / xlsx.js

XLSX.js is a JavaScript library for converting the data in base64 XLSX files into JavaScript objects - and back! Please note that this library is licensed under the Microsoft Office Extensible File License - a license NOT approved by the OSI. While this license is based off of the MS-PL, which is OSI-approved, there are significant differences.
http://blog.innovatejs.com/?tag=xlsx-js
Other
575 stars 122 forks source link

Space ' ' character not added to sharedStrings #43

Open JimBobBagel opened 7 years ago

JimBobBagel commented 7 years ago

I'm using xlsx.js to export an html table to a xlsx workbook. When opening the workbook an error occurs in the sheet1.xml file which excel easily fixes. This problem can be fixed by updating line 186 (in my version of xlsx.js) to add blank spaces to the sharedStrings.xml file.

Old: if (val && typeof val === 'string' && !isFinite(val)) { New: if ((val && typeof val === 'string' && !isFinite(val)) || val.trim() == '') {