This is a migrated thread and some comments may be shown as answers.

Grid Export to Excel Error .saveAsExcel()

1 Answer 547 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 07 Feb 2017, 10:48 PM

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();

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Feb 2017, 12:27 PM
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 (charts) and form elements.
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or