TableExport icon indicating copy to clipboard operation
TableExport copied to clipboard

Error with file format and extension on export to Excel v5

Open dotnetshadow opened this issue 6 years ago • 1 comments

Hi there,

Great Library, when exporting to xls using exportButtons false, I seem to be getting the error message: The file format and extension don't match

Using library v5.0.2, running localhost

var instance = $('table').tableExport({
                    formats: ['xls'],
                    exportButtons: false,
                    filename: 'File1'
                });

                var exportData = instance.getExportData()['tableexport-1']['xls'];

                instance.reset();
                instance.export2file(exportData.data, 'application/vnd.ms-excel', exportData.filename, exportData.fileExtension);

dotnetshadow avatar Oct 02 '18 02:10 dotnetshadow

@dotnetshadow – Do you get the same error when you remove instance.reset();?

clarketm avatar Oct 24 '18 06:10 clarketm