Showing posts from January, 2014

Exporting Kendo UI GRID to Excel with Java

This is a simple method of creating an Excel export function on your Kendo UI grid with a Java EE server.
JS function to trigger Excel export In your web-page with the grid - insert this JS function. You should create a button or similar that calls this when you want to perform the export from the UI.
function exportGridToExcel() { var grid = $("#grid").data("kendoGrid"); var currentPage =; var allPages = new Array(); for(var n=1;n<=grid.dataSource.totalPages();n++) {; var view = grid.dataSource.view(); for(var x=0;x<view.length;x++) { allPages.push(view[x]); } } $("#excelExportGridData").val(JSON.stringify({"rows": allPages, "cols": grid.columns})); $("#exportToExcelForm").submit();; } Hidden form and iframe You also need a …