PDF export template issues

4 posts, 0 answers
  1. Ludek Soukup
    Ludek Soukup avatar
    6 posts
    Member since:
    Apr 2009

    Posted 26 Jul 2017 Link to this post

    Hi,

    im trying to export PDF from my kendo grid but im facing some issues with pdf export settings. 

    @(Html.Kendo().Grid<Statistics.Models.Inspection>()
               .Name("grid")
               .Pdf(pdf => pdf
               .AllPages()
               .PaperSize("A4")
               .AvoidLinks()
               .Scale(0.8)
               .RepeatHeaders()
               .Margin("2cm", "1cm", "1cm", "1cm")
               .TemplateId("page-template")
               .FileName("Export.pdf")
     
           )
           .Excel(exc=>exc.AllPages(true).Filterable(true).FileName("exc.xlsx"))

     

    Excel is working fine.

    But PDF always exports only 1 visible page from the grid (and only few columns that fit to the page). I figured out that if i remove .PaperSize("A4") it is showing all data BUT its completely ignoring template and it renders grid to pdf with all buttons. 

     

    Thanks 

  2. Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 28 Jul 2017 Link to this post

    Hello Ludek,

    Regarding the mentioned issues:

    1) Only the first page is exported- We had a known issue when the Grid is scrollable and the paperSize is set to A4. Please set the scrollable property of the Grid to false in order to check if this will fix the issue. Also, updating to the latest version may fix it as well, as we fixed some of the combinations of setting which caused the mentioned issue.

    2) If all columns are not visible, we can suggest setting a small enough scale value in order to scale the Grid to a point where all column are visible in A4 paperSize dimensions.

    3) When the paperSize is set to auto, all of the Grid layouts will be exported. Also, when the template is used, it requires a paperSize to be set(different than auto):

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-pdf.template

    If the issue still occurs, please send a fully runnable example and I will gladly assist.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Ludek Soukup
    Ludek Soukup avatar
    6 posts
    Member since:
    Apr 2009

    Posted 03 Aug 2017 in reply to Stefan Link to this post

    Thanks for reply ... i managed to fix it  ... but now i have troubles with fonts on IE 11. Chrome,edge are working fine. Im using Roboto font. But the export result is containing a weird font (squares) (attached screenshot). 

    I tried 

    kendo.pdf.defineFont({ 
    "Roboto": "~/fonts/Roboto-Regular.ttf",
    "Roboto-Black": "~/fonts/Roboto-Bold.ttf",
    });

     

    but no success. The example demo is working fine.

  4. Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 07 Aug 2017 Link to this post

    Hello Ludek,

    I can assume that this may be a browser related issue with the mentioned font.

    If possible, please provide us with the used font files, so we can make a local example and test what may be causing the issue and advise if it can be fixed from our side.

    Thank you in advance.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top