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

Grid from table - export to excel

1 Answer 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 20 Nov 2019, 03:30 PM
If I have a table and convert it over to a kendogrid, are you then able to export that to excel? When I try, I get saveAsExcel not defined. I even get it when I run one of the examples from the site in Dojo.

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 20 Nov 2019, 04:41 PM

Hello George,

Here's a dojo example that uses the code from one of our Grid demos (Popup editing) and has a button added on top of the Grid that triggers the export:

$("#export").click(function(e) {
  var grid = $("#grid").data("kendoGrid");
  grid.saveAsExcel();
});

Note that the jszip script is added to the head tag:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.min.js"></script>

As mentioned in the Grid's Excel Export documentation, it is required for the export to work.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or