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

Queries regarding Kendo Grid PDF Export

3 Answers 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 02 Apr 2019, 01:51 PM

I am using the GridPDFExport in my application. While doing so , I am facing following queries : 

1. The background of the grid is by default shown in the fashion that white and grey colors get applied to the alternate rows. I have customized the background color for the grid but that styling disappears on Export PDF.

2. Unable to change the Font and Color while exporting the Grid in PDF document. Increasing the scaling property doesn't work for my scenario as there are large number of columns i want to export. Thus my scale is set to 0.3. I have to increase the Font as well change the font color while exporting the Grid.
Even after using PageTemplate , it didn't work for me.

Kindly suggest the suitable solution.

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Apr 2019, 08:15 AM
Hello, Sandeep,

Both questions can be resolved with CSS. There is a CSS selector ''k-pdf-export' that is added only to the exported document.

It can be used to set the desired styles, font, etc to the export PDF document:

.k-pdf-export td,
.k-pdf-export th {
    font-family: "DejaVu Sans", "Arial", sans-serif;
    font-size: 100px;
    color: blue;
    background-color: red;
}

This is an example:

https://stackblitz.com/edit/react-jku7vs?file=index.html

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sandeep
Top achievements
Rank 1
answered on 03 Apr 2019, 11:43 AM
Thanks. It is working for me but there is some issue . If the number of records is more , it is not extending the PDF to multiple pages. Can you please suggest any solution for that ?
0
Stefan
Telerik team
answered on 04 Apr 2019, 06:29 AM
Hello, Sandeep,
 
The following article demonstrates how to export all of the Grid pages:

https://www.telerik.com/kendo-react-ui/components/grid/pdf-export/all-pages/

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Sandeep
Top achievements
Rank 1
Share this question
or