I pulled the files from the original kendo installation folder and that seem to fix the PDF, but for Excel, I now have a issue where it will only print when the grid is grouped. Here is the code that will show you the issue - I have a button that toggles the grouping pane when clicked - also, I found I had to manually adjust the grid.content because when redrawn with the grouping pane hidden it left a blank space at the bottom the height of the grouping pane. Perhaps there is a better way to hide/show the grouping pane. I have to conserve vertical space in my app, so I don't want it visible when users don't want to group.
Here is an example - if you click the group button, you will find you can no longer export...
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>Kendo UI Snippet</
title
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.common.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.rtl.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.dataviz.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.dataviz.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.mobile.all.min.css"
>
<
script
src
=
"http://code.jquery.com/jquery-1.9.1.min.js"
></
script
>
<
script
src
=
"http://kendo.cdn.telerik.com/2015.3.1111/js/jszip.min.js"
></
script
>
<
script
src
=
"http://kendo.cdn.telerik.com/2015.3.1111/js/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"grid"
></
div
>
<
script
>
$("#grid").kendoGrid({
toolbar: ["excel"],
excel: {
fileName: "Kendo UI Grid Export.xlsx"
},
dataSource: {
type: "odata",
transport: {
},
pageSize: 7,
group : { field :"ProductName"}
},
groupable: true,
sortable: true,
pageable: true,
height : 300,
columns: [
{ width: 300, field: "ProductName", title: "Product Name" },
{ field: "UnitsOnOrder", title: "Units On Order" },
{ field: "UnitsInStock", title: "Units In Stock" }
]
});
function groupClick(gridName) {
var grid = $(gridName).data("kendoGrid");
var _gridName = gridName.replace('#', '');
grid.groupable = !grid.groupable;
// record the height of both so we can adjust because the grid won't fill the content div
var groupHeight = $(gridName + " .k-grouping-header").outerHeight();
var contentHeight = grid.content.outerHeight();
if (grid.groupable) {
$("#toolbar-group-" + _gridName).addClass('k-state-active');
$(gridName + " .k-grouping-header").css('display', 'block');
// adjust content size
grid.content.css('height', contentHeight - groupHeight);
}
else {
grid.dataSource.group("");
$("#toolbar-group-" + _gridName).removeClass('k-state-active');
$(gridName + " .k-grouping-header").css('display', 'none');
// adjust content size
grid.content.css('height', contentHeight + groupHeight);
if (_gridName == 'grid') gridHeight = contentHeight + groupHeight;
}
grid.content.scrollTop(0);
return false;
};
</
script
>
<
button
onclick
=
"groupClick('#grid');"
>Group</
button
>
</
body
>
</
html
>