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

PDF should export all data instead of current visible data on the Grid

4 Answers 904 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sree Divya
Top achievements
Rank 1
Sree Divya asked on 03 Oct 2018, 12:23 PM

Hi,

we have a requirement to export all the response data to PDF. currently when we export the PDF, its exporting only the current visible Grid data (exporting 10 records instead of 25 records). we are using virtual scrolling just fyi.

We noticed that in Kendo export excel (https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#toc-exporting-specific-data) there is a similar property which we had effectively used and achieved the requirement (exporting all the 25 records instead of current visible 10 records in Grid)  whereas when we want to do it with PDF, we couldn't achieve it. Can you help us regarding it.

4 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 03 Oct 2018, 12:34 PM
Hi Sree,

The Grid PDFExport has a dedicated allPages property specifically designed to export the whole data to the PDF instead of the currently visible items only:

https://www.telerik.com/kendo-angular-ui/components/grid/export/pdf-export/#toc-exporting-all-pages

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sree Divya
Top achievements
Rank 1
answered on 03 Oct 2018, 01:49 PM

Hi,

I have tried setting the allpages property to true, but it was only exporting the current visible data on the grid . I am looking for property like fetchData in excel export where we can assign data to ExcelExportData interface.

0
Sree Divya
Top achievements
Rank 1
answered on 03 Oct 2018, 02:16 PM
The 'all pages' thing has a limitation that the page should render all the records, even if its offscreen.
But what am looking for is more like,  passing our OWN DATA object to the export pdf method, like what we do with excel [fetchData]="myData"
0
Dimiter Topalov
Telerik team
answered on 05 Oct 2018, 12:47 PM
Hello Sree,

The difference between the Excel and PDF export functionalities is that the latter needs the items that will be exported to be rendered in the DOM because it needs to calculate the respective dimensions of each DOM element representation in the generated output. This is why it cannot automatically create a PDF document based on a data collection only like the ExcelExport.

It internally uses the Drawing API that you can also potentially use to create a custom PDF document, based on a collection of elements, but this seems rather tedious and complex when compared to the built-in functionality.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Sree Divya
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Sree Divya
Top achievements
Rank 1
Share this question
or