egeriis / zipcelx

Turns JSON data into `.xlsx` files in the browser
MIT License
293 stars 90 forks source link

Some numbers not supported by Excel #53

Closed osthoren closed 5 years ago

osthoren commented 5 years ago

Hello!

I'm not certain on how to report this, but I'll give it a try: It seems like when numbers are exported using zipcelx, Microsoft Excel is not happy with the formatting of the file. When opened in Excel it says: "We found a problem with some content .xlsx. Do you want us to try and recover as much as we can?"

When clicked 'no' the file is opened and all cells are cleared and empty. When clicked 'yes' the file is opened and are cells are displayed correctly, as expected. The log-file from the repair informs:

Repaired Records: Cell information from /xl/worksheets/sheet1.xml part

I've noticed this has something to do with the number formatting. When the exported file only contains strings, no warning are found and the file is correct. The 'warning' can however be avoided by exporting numbers as strings - this unfortunately genenerates warnings on each cell where 'number is stored as text' after the file has been opened.

Has anyone experienced this or maybe know where the source of the problem lies?

egeriis commented 5 years ago

@oscarbergstrom Did you find the solution, since you closed the issue? I'm curious

osthoren commented 5 years ago

@egeriis : Nope. It was a backend-issue on my part. I figured out that there were cells exported which were defined as numbers, but in fact contained a string "NaN". This caused Microsoft Excel to re-format these cells to type String and hence the warning.