Hello,
is it possible when using the built-in PDF export functionality to make it list each grouped section (created via Ajax().Group()) onto its own page?
I'm required to create two types of reports. One that exports all items combined into a single report and a second one that exports based on grouping of a specific column. I have the grid grouped correctly but when exporting, I need each group on it's own page rather than displayed all in one grid.
Is there built-in functionality for this or a known work-around?
Thank you.
6 Answers, 1 is accepted
In order to implement the functionality you describe, use the forcePageBreak selector in the PDF options of the Grid; you can read more about it here, and it would look like:
pdf: {
forcePageBreak:
".k-grouping-row:not(:first-child)"
}
I encourage you to take a look at the following sample in the Kendo UI Dojo demonstrating the approach described above.
I hope this helps!
Regards,
Eduardo Serra
Progress Telerik
![](/forums/images/avatarimages/febd0f27-16dd-4c94-b45d-506b535cc48clogotype.png)
In order to implement the functionality you describe, use the forcePageBreak selector in the PDF options of the Grid; you can read more about it here, and it would look like:
pdf: {
forcePageBreak:
".k-grouping-row:not(:first-child)"
}
I encourage you to take a look at the following sample in the Kendo UI Dojo demonstrating the approach described above.
I hope this helps!
Regards,
Eduardo Serra
Progress Telerik
[/quote]
Hi Eduardo,
does forcePageBreak exist in the MVC grid pdf component? It doesn't appear so. To implement its usage, would I have to switch from my current Razor ASP MVC grid to the jQuery grid for this page?
![](/forums/images/avatarimages/febd0f27-16dd-4c94-b45d-506b535cc48clogotype.png)
I have found a workaround using the .setOptions JS method of the grid that allows me to still use my MVC grid. In case anyone else comes across this issue and wants to stick with the MVC component you can add this JavaScript to your page. Declare all other settings in your original MVC grid. If you have the PDF export button in your toolbar, you'll have re-add it as seen in my example below.
$(
'#yourGridName'
).getKendoGrid().setOptions({
pdf: {
forcePageBreak:
".k-grouping-row:not(:first-child)"
,
},
toolbar: [
"pdf"
]
});
There is no equivalent property in the UI for ASP.NET MVC Wrappers, your approach is valid.
Thank you for sharing your solution in the Forums.
Regards,
Eduardo Serra
Progress Telerik
![](/forums/images/avatarimages/default.gif)
Try setting the pdf options only via setOptions(), without overwriting the toolbar configuration:
$(
'#yourGridName'
).getKendoGrid().setOptions({
pdf: {
forcePageBreak:
".k-grouping-row:not(:first-child)"
,
}
});
Regards,
Tsvetina
Progress Telerik