18 Answers, 1 is accepted
The PDF export renders the currently visible DOM tree of the grid in order to provide similar look and feel. To render all pages you need to disable paging so all pages are visible at the time of export.
Excel export works only with the data of the grid and doesn't care about the visible DOM. This is why it supports exporting all data.
Regards,
Atanas Korchev
Telerik
I guess we'll have to stick with our code that generates the export on the server, which is unfortunate, because I was really looking forward to this out-of-the-box functionality.
Frank Wanicka
The default configuration of Excel export doesn't export all pages. This means that by default Excel and PDF export will use the current page of data. If you want to export all pages in PDF and use the built-in export you have to disable paging.
We will look into providing some support or workaround for all pages. It is rather difficult though because the grid should render all pages one by one during PDF export. This won't perform well with a large number of pages due to the number of DOM changes.
Regards,
Atanas Korchev
Telerik
We're currently working on making multi-page export a feature.
I've attached a sample that you can run against the current internal build.
It still requires user code and will not be a built-in feature until at least the Q2 release in March.
Thank you for your patience.
Regards,
T. Tsonev
Telerik
At present we're having some issues with our subscription so we're not able to download internal builds.
I'm attaching the latest internal build here for your convenience.
I had to remove the demos and source code to get it into the file size limits.
I'd also like to inform you that the Q2 version will support built-in support for exporting all pages.
A beta is available right now with the official release scheduled for next week.
Regards,
T. Tsonev
Telerik
I downloaded the Q2 2015 version(with hotfix) but still unable to Export All the Pages using pdf. Please suggest a workaround.
You need to download the Q1 2015 version to get this feature. Then make sure you have set the pdf.allPages option to true.
Regards,
Atanas Korchev
Telerik
Hello Lynx IT,
No, this is not a known issue. Can you reproduce it in this demo?
Regards,Atanas Korchev
Telerik
Hello,
It sounds a lot like the old version is still in use. Can you please check if the new scripts have been loaded?
Try the following in the browser console:
> kendo.version
Does this show 2015.1.318 or later?
Regards,T. Tsonev
Telerik
We are using version: 2015.2.805 and if I add "allPages" to the javascript definition, the browser hangs. Doesn't matter which browser(IE, Firefox, Chrome), they all hang...I am only pulling 107 records. I tried to put them on one page, but then they were REALLY small on the pdf so I am trying multiple pages now. I really need to get this working if possible. Will include my Grid definition below. There is NOTHING else in the view except a small header which I don't care about. Just want to export the Grid. Version of Jquery I am using is: 2.1.4. Not sure if that is part of the problem or not.
Thanks again...
Grid definition.
<div id="grid"></div>
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: "json",
sort: [
{field: "DepartmentName", dir: "asc"},
{field: "FullName", dir: "asc"}
],
transport: {
read: "/api/Person"
},
pageSize: 30,
group: { field: "DepartmentName" }
},
dataBound: function(e) {
exportGrid();
},
pageable: true,
groupable: false,
pdf: {
allPages: true,
fileName: "​ourfilename.pdf",
landscape: false,
multiPage: true,
margin: {
left: 25,
right: 25,
top: 25,
bottom: 25
},
//paperSize: "A4",
title: "Directory",
subject: "Directory"
},
columns: [
{
//template: "<a href=\"/Person/Edit/#:data.Id#\">#:data.FullName#</a>",
field: "FullName",
title: "Name",
width: 300
}
, {
field: "Title",
title: "Title"
},
{
field: "DepartmentName",
title: "Department",
groupHeaderTemplate: "#= value #", hidden: true
}
, {
field: "PhoneExtension",
title: "Phone"
}
],pdfExport: function(e) {
e.promise
.progress(function(e) {
//console.log(kendo.format("{0:P} complete", e.progress));
})
.done(function () {
//window.showInfo("PDF Download", "Export Complete!");
//alert("Export completed!");
});
}
});
});
//$("#grid").data("kendoGrid").saveAsPDF();
function exportGrid()
{
var grid = $("#grid").data("kendoGrid");
grid.saveAsPDF();
}
</script>
Based on my test snippet I would advise against calling saveAsPDF in the dataBound handler.
The allPages option will page the data source, so you'll get an endless recursion as a result.
Regards,
T. Tsonev
Telerik