TableExport icon indicating copy to clipboard operation
TableExport copied to clipboard

Missing parameter in the typings of the export2file method

Open d-fankhauser opened this issue 5 years ago • 2 comments

Some parameters are missing in the .ts file.

Version: 5.2.0

File: tableexport.d.ts

    /**
     * Exports and downloads the file
     */
    export2file: (data: string, mime: string, name: string, extension: String) => void;

It should be something like this

    export2file: (data: string, mime: string, name: string, extension: String, merges: Object, rtl: Boolean, sheetname: String) => void;

File: tableexport.js

    /**
     * Exports and downloads the file
     * @memberof TableExport.prototype
     * @param data {String}
     * @param mime {String} mime type
     * @param name {String} filename
     * @param extension {String} file extension
     * @param merges {Object[]}
     * @param RTL {Boolean}
     */
    export2file: function(data, mime, name, extension, merges, RTL, sheetname) {

Without sheetname, you can't use export2file Method - excel will bring the warning, that the file is corrupt.

d-fankhauser avatar Mar 06 '19 15:03 d-fankhauser

Yes, same error with xlsx

churongcon avatar Jul 30 '19 05:07 churongcon

It's really a big trouble for guys who want to customize buttons but fall into this trap, along with the misleading example: https://github.com/clarketm/TableExport/blob/master/examples/exportButtons.html#L105

dickeylth avatar Nov 14 '19 06:11 dickeylth