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

PDF export template issues

3 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ludek Soukup
Top achievements
Rank 1
Ludek Soukup asked on 26 Jul 2017, 02:16 PM

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 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 28 Jul 2017, 07:07 AM
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.
0
Ludek Soukup
Top achievements
Rank 1
answered on 03 Aug 2017, 03:03 PM

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.

0
Stefan
Telerik team
answered on 07 Aug 2017, 07:54 AM
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.
Tags
Grid
Asked by
Ludek Soukup
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ludek Soukup
Top achievements
Rank 1
Share this question
or