Skip to content
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

Character and compatibility bugs with XLS and CSV exporting #20

Closed
ChartHeaven opened this issue Nov 19, 2015 · 9 comments
Closed

Character and compatibility bugs with XLS and CSV exporting #20

ChartHeaven opened this issue Nov 19, 2015 · 9 comments

Comments

@ChartHeaven
Copy link

I found the following bugs when testing the client-side export module plugin with CSV and XLS exporting, can you please fix them?

BUG 1

With a particular amount of categories and series data scandinavian characters (ä, ö) and euro sign (€) are not displayed correctly in the XLS file

http://jsfiddle.net/pscjzhe4/208/

However, strangely it starts working if you add more categories and series data:

http://jsfiddle.net/pscjzhe4/209/

BUG 2

Scandinavian characters (ä, ö) and euro sign are not displayed correctly at all in the CSV file (no matter if you have more or less categories and series data in the CSV file

http://jsfiddle.net/pscjzhe4/210/

BUG 3

If you open the exported XLS file in Excel 2013 you'll get an error message saying that "The file format and extension of [filename].xls don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?" If you click Yes, it will open the file in Excel. However, it always shows this error message when trying to open the exported XLS file, so it's just annoying and confusing for users to see it every time.

@A----
Copy link
Owner

A---- commented Nov 19, 2015

OK so first, the issue is with this plugin https://github.com/highslide-software/export-csv/ , I'm merely using it in under a unified interface.

So, about bug 1: I tried to had a BOM ( https://en.wikipedia.org/wiki/Byte_order_mark ) and that fixed your issue. It have been reported already, see highcharts/export-csv#27 .
There's also that that may work highcharts/export-csv#51 .

Regarding bug 2, I can't seem to be able to reproduce this issue here:
image

Bug 3, yeah, it's a known issue. It has been reported and it can't be fixed. See #13 and highcharts/export-csv#41 .

@A---- A---- closed this as completed Nov 19, 2015
@ChartHeaven
Copy link
Author

Where did you put the BOM? Can you show example code? I tried to edit the export-csv.js file by adding a.href = 'data:text/csv;charset=utf-8,%EF%BB%BF' + this.getCSV().replace(/\n/g, '%0A'); but it didn't help.

@A----
Copy link
Owner

A---- commented Nov 19, 2015

I didn't try to patch the library, I just added the BOM using Notepad++. I found out that there was existing issues afterwards.

Seems like your version is a tad old. On the master branch, I'd add it there:

Be aware that on raw content, the BOM shouldn't be URL-encoded.

@A----
Copy link
Owner

A---- commented Nov 19, 2015

Sorry, yeah, the issue is in my code, not export-csv

@A---- A---- reopened this Nov 19, 2015
@A----
Copy link
Owner

A---- commented Nov 19, 2015

Prepend "\ufeff" to the string there:

That fixed the issue here. I don't have the time to do a proper fix at the moment, but will do.

@ChartHeaven
Copy link
Author

Thanks, it fixed the BUG 1 and BUG 2 also on my side. You sure that the BUG 3 cannot be fixed? Is it an Excel issue or export-csv issue?

@A----
Copy link
Owner

A---- commented Nov 19, 2015

I may be wrong, I'm no Excel expert.

The format used isn't the same as XLS, hence the warning. From what I can grasp, that some Office XML format ( https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats ). So, yeah, it's probably possible to write a correct Office XML file, but it's extension would have to be xml for the warning not to appear.
Default application for XML files is Internet Explorer on Windows, so users would be lost.

The easier format openable with Excel would probably be ODS, but that'd be some work. You're welcome to try though.

@ChartHeaven
Copy link
Author

Here is Microsoft's official answer and solution to the error message given by Excel . The issue is caused by a new security feature in Excel. It can only be fixed by changing Windows' registry settings (I tested it and it works).

http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/03/11/excel-2007-extension-warning.aspx

A---- added a commit that referenced this issue Nov 20, 2015
@A----
Copy link
Owner

A---- commented Nov 20, 2015

Release for this issue has been published: https://github.com/A----/highcharts-export-clientside/releases

@A---- A---- closed this as completed Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants