rainabba / jquery-table2excel

jQuery Plugin to export HTML tabled to Excel Spreadsheet Compatible Files
593 stars 666 forks source link

How to change extension #52

Closed akeilox closed 8 years ago

akeilox commented 8 years ago

I am using Office 2016 and it doesnt seem to open the .xlsx default extension. But when i manually change the extension to .xls it opens with warning.

Is there any way to force the extension to be .xls?

I did note the readme but couldnt find a way to force the extension default; ..The .xls extension is the only way [some versions] of excel will even open it, and you will get a warning about the contents which can be ignored....

rainabba commented 8 years ago

Just make the extension what you want when you save the file or change it in your file manager afterwards.

akeilox commented 8 years ago

many thanks for the reply.

Is there any way in the code to make it download file as .xls instead of .xlsx to the browser? Or it must be xlsx due to some reason, just curious on why it must be xlsx..

rainabba commented 8 years ago

It's .xlsx primarily because that's the correct extension for an OpenXML Spreadsheet file ( https://msdn.microsoft.com/en-us/library/aa338205(v=office.12).aspx ). Also, Excel is inconsistent on the use of this XML format and different users report the same issue for both the .xls and .xlsx extension. If you haven't read it yet, please see: https://github.com/rainabba/jquery-table2excel#disclaimer

akeilox commented 8 years ago

Many thanks for clarifying.

I did read the disclaimer on changing the extension for 'some' cases. If users are all on Office 2016, .xls extension seems to be the only way they can open it. I understand the implications and looking for an intranet type setting.

In that case, can I override in the code for the extension to be downloaded as .xls (without asking/training user to rename the extension) ?

rainabba commented 8 years ago

I won't take a PR to change it in this code base because it would just go back and forth over time, but you can always fork and make any changes to your own project. I would take a PR that exposed that functionality in the call and provided examples in the README so that each person implementing could then target their audience by providing alternate extensions and that would be easy enough.

rainabba commented 8 years ago

I won't take a PR to change it in this code base because it would just go back and forth over time, but you can always fork and make any changes to your own project. I would take a PR that exposed that functionality in the call and provided examples in the README so that each person implementing could then target their audience by providing alternate extensions and that would be easy enough. ᐧ

On Tue, Aug 9, 2016 at 11:44 PM, akeilox notifications@github.com wrote:

Many thanks for clarifying.

I did read the disclaimer on changing the extension for 'some' cases. If users are all on Office 2016, .xls extension seems to be the only way they can open it. I understand the implications and looking for an intranet type setting.

In that case, can I override in the code for the extension to be downloaded as .xls (without asking/training user to rename the extension) ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rainabba/jquery-table2excel/issues/52#issuecomment-238779459, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhynohIkoNqNI6ugXa74eQhg8K6HfUWks5qeXM0gaJpZM4Jf-Nl .

From Rainabba@gmail.com