Flexgrid export to excel error

Posted by: johan.holmstrom on 30 June 2020, 9:41 pm EST

    • Post Options:
    • Link

    Posted 30 June 2020, 9:41 pm EST

    Hi! Im a real newbie with flexgrid and try to have a grid exported to excel.

    I get a inline js error: this._saveFlexGridToWorkbook is not a function

    at new FlexGridXlsxConverter.save from my minified js.

    I tried with alot of examples of the export and the current js looks like this:

    div.addEventListener(‘mousedown’, function () {

    var book = new wijmo.grid.xlsx.FlexGridXlsxConverter.save(me.grid, {

    includeColumnHeaders: true,

    includeRowHeaders: true

    });

    //name the sheet

    book.sheets[0].name = ‘FlexGrid Data’;

    // save the book

    book.save(‘FlexGrid-Export.xlsx’);

    });

    I can see that the grid is correct and that i am calling the FlexGridXlsxConverter method. Also i tried with save and saveAsync, tried with filename included in the save method as well. So i feel kinda stuck :slight_smile: Any suggestions?

  • Posted 1 July 2020, 5:12 pm EST

    Hi Johan,

    The issue is with the code snippet you are using to export the FlexGrid. Please refer to the following demo sample and the code snippet for reference:

    https://www.grapecity.com/wijmo/demos/Grid/ImportExportPrint/Excel/Async/purejs

    
    var book = wijmo.grid.xlsx.FlexGridXlsxConverter.save(me.grid, {
    includeColumnHeaders: true,
    includeRowHeaders: true
    });
    //name the sheet
    book.sheets[0].name = 'FlexGrid Data';
    // save the book
    book.save('FlexGrid-Export.xlsx');
    

    Regards,

    Manish Gupta

  • Posted 1 July 2020, 6:10 pm EST

    Thanks Manish! When i removed the “new” from the converter it worked.

    Kind regards

    Johan

Need extra support?

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

Learn More

Forum Channels