Export grid to pdf with multiple pages without setting pageSize

3 posts, 0 answers
  1. Lich
    Lich avatar
    6 posts
    Member since:
    Jul 2015

    Posted 15 Feb 2016 Link to this post

    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. Lich
    Lich avatar
    6 posts
    Member since:
    Jul 2015

    Posted 16 Feb 2016 Link to this post

    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

  3. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2206 posts

    Posted 18 Feb 2016 Link to this post

    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!
     
Back to Top