Open oyvindwh opened 7 years ago
If I remember correctly we haven't found a way to work around this issue. The contents of the file is a HTML table, but Excel interprets it correctly nonetheless.
Its quite involved to generate real Excel data. It would probably be best to integrate with a 3rd party javascript lib, e.g. https://www.travismclarke.com/tableexport/ (that's just one I found from google) Not sure how difficult it would be to integrate.
Here's a proof of concept of using TableExport: http://jsfiddle.net/highcharts/hr7jLwda/
Does the produced Excel file look good to you?
If this is working, we can consider providing a hook for it in the export-csv plugin (which will soon become an integrated Highcharts module). We can plug it into our own file download functionality so we won't depend on FileSaver.js.
I'm still getting the error, BUT I am using a newer version of Excel which is looking for xlsx type. it should work for older versions of Excel that are expecting xls.
I have updated the example here for xlsx: http://jsfiddle.net/ahdavis/hr7jLwda/3/ I added the xlsx.core.js include at the top and changed the format to xlsx on line 9. However, highcharts is still sending an extension of xls instead of xlsx. I think if this could be changed, then it would work for xlsx, and then you would need an additional Download XLSX option.
Thanks for contributing - the path to core.xlsx.js was wrong, but once fixing that, the extension also became correct. I added a separate menu item for XLSX: http://jsfiddle.net/highcharts/hr7jLwda/
Great, xlsx works for me now! Thank you!
When downloading to excel from the module, I get an error when opening the file. If I choose to accept the content of the file is correct. Can I change/update the script to remove the error message?