Vikram Anand Bhushan
Vikram Anand Bhushan

Reputation: 4886

Excel file generated by table2excel jQuery plugin throws error when opened

I have a HTML table that I want to export to Excel using the table2excel plugin. Unfortunately when I download it, the generated Excel file has an error. How can I fix that?

I have created a JSFiddle.

Basically to call the plugin you just need to do this:

$("#downloadIntermidiate").click(function(){

                        $("#intermediateTable").table2excel({
                              exclude: ".noExl",
                        name: "Excel Document intermediateTable"
                        }); 

                         });

Here #intermediateTable is the id of the table that has to be printed.

Upvotes: 1

Views: 7474

Answers (1)

Anoop B.K
Anoop B.K

Reputation: 1478

You fiddle works Fine, Just Changed .xlsx to .xls , it exports

function getFileName(settings) {
    return ( settings.filename ? settings.filename : "table2excel") + ".xls";
 }

Check this fiddle-> https://jsfiddle.net/t8tegrad/8/

Upvotes: 4

Related Questions