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

Export grid to pdf with multiple pages without setting pageSize

2 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lich
Top achievements
Rank 1
Lich asked on 15 Feb 2016, 11:28 PM

Hi, how can i export grid to pdf with multiple pages without setting pageSize. My grid has 400 rows.

this is what i am using now

  function exportPDF() {         var grid = $("#MainGrid").data("kendoGrid");         var progress = $.Deferred();         grid.dataSource.pageSize(32);         grid._drawPDF(progress)             .then(function(root) {                 return kendo.drawing.exportPDF(root, {                     multiPage: true                 });             })             .done(function(dataURI) {                 kendo.saveAs({                     fileName: "SP Orders_" + getCurrentDate() + ".pdf",                     dataURI: dataURI                 });                 progress.resolve();             });

 

 

        globControls.btnPdf.kendoButton({             click: function (e) {                 if (rowCount > 0) {                     exportPDF();                     //set back pageSize//                    var dataSource = $(".k-grid").data("kendoGrid").dataSource;//                    dataSource.pageSize(dataSource.total());                     // globControls.mainGrid.data("kendoGrid").saveAsPDF();                 } else {                     e.preventDefault();                 }             }         });

2 Answers, 1 is accepted

Sort by
0
Lich
Top achievements
Rank 1
answered on 16 Feb 2016, 02:09 PM

Right now i can export to pdf with multiple pages because i set the pageSize. But after that, my grid just show only the number of row i just set in pageSize. I set pageable to false, allPages to true.

when i set pageable to true, it work correctly.

Can anyone help me?

THank you

0
Vladimir Iliev
Telerik team
answered on 18 Feb 2016, 09:30 AM
Hi Lich,

I'm not sure that I understand the exact scenario that you have - could you please provide runeable example where the issue is reproduced? Another option is to at lease provide related Grid configuration and small screencast that demonstrates the issue. This would help us advice you better how to proceed. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Lich
Top achievements
Rank 1
Answers by
Lich
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or