excelIO.save returning error : Incorrect file format

Posted by: vinay.kevadia on 10 August 2018, 2:38 am EST

    • Post Options:
    • Link

    Posted 10 August 2018, 2:38 am EST

    I am trying this export to .xlsx example for my application. http://help.grapecity.com/spread/SpreadSheets10/JavascriptLibrary~GC.Spread.Excel.IO~save.html

    Here the code that i am trying.

    
            vm.spread = vm.spread = new GC.Spread.Sheets.Workbook($document[0].getElementById('test_element'), { sheetCount: 1 });
    
    
    	var fileName = 'test.xlsx';
            var json = JSON.stringify(vm.spread.toJSON());
            var excelIO = new GC.Spread.Excel.IO();
            excelIO.save(json, function (blob) {
                    console.log(blob)  // returning : Blob(6280) {size: 6280, type: "application/zip"}
                    saveAs(blob, fileName);
            }, function (e) {
                    console.log(e);  // Returning error : {errorCode: 1, errorMessage: "Incorrect file format."}
            });
    
    
  • Posted 10 August 2018, 7:30 am EST

    Hello,

    Could you please clarify which version of SpreadJs library are you using?

    As here is the documentation link for the latest version:-

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#excelclient.html

    Request you to please share a small working sample replicating the issue so that we can investigate this issue further.

    Thanks,

    Reeva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels