Grid Export to Excel Error .saveAsExcel()

2 posts, 0 answers
  1. Dennis
    Dennis avatar
    1 posts
    Member since:
    Dec 2016

    Posted 07 Feb Link to this post

    I'm getting the following error when trying to call the method .saveAsExcel(): "Unable to get property 'length' of undefined or null reference"

    Here is code:

    $(".download-excel").on("click",
        function() {
            try {
                var grid = $("#DataGrid").data("kendoGrid");
                grid.saveAsExcel();
            } catch (e) {
                fnDialog('Error Exporting Excel',
                    'There was an error exporting the excel document. Please contact customer service.',
                    null,
                    null);
            }
        });

     

    If I set a watch on the grid object, I can see the data. For some reason it fails at the grid.saveAsExcel();

  2. Stefan
    Admin
    Stefan avatar
    428 posts

    Posted 09 Feb Link to this post

    Hello Dennis,

    This is not a known issue and it was not reproduced in my testing scenario.

    I made an example using similar implementation and the Grid was correctly exported to Excel:

    http://dojo.telerik.com/eMoqe

    If I missed an important detail, please modify the provided Dojo and I will gladly assist.

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top