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

Exclude columns from PDF, EXCEL export of Grid

2 Answers 842 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dimitris
Top achievements
Rank 1
Veteran
Dimitris asked on 20 Nov 2020, 12:42 PM

When exporting PDF files we can set which pages we want to include in the pdf, but if we do show we will also include columns hidden by the user. Is there any option to avoid this. Is there an option to declare just the fields we want to exclude from the export? For example I have an actions column with  edit, delete actions in that column and I don't want to include it in the PDF or EXCEL exports. But I want to include only the VISIBLE columns.

I tried something like this:

<kendo-grid-pdf fileName="my.pdf" [allPages]="true" [landscape]="true" paperSize="A4" [repeatHeaders]="true" [scale]="0.8">
      <kendo-grid-pdf-margin top="1cm" left="1cm" right="1cm" bottom="1cm"></kendo-grid-pdf-margin>
      <kendo-grid-column field="actions" hidden="true" ></kendo-grid-column>
</kendo-grid-pdf>

but this takes 'actions' as the only column to export in the PDF.

2 Answers, 1 is accepted

Sort by
0
Dimitris
Top achievements
Rank 1
Veteran
answered on 20 Nov 2020, 12:44 PM

Sorry for the replies to my own questions, but I don't have an EDIT button!

Adding a second question:
Why there is no [allPages]="true" for EXCEL export too???

 

0
Martin Bechev
Telerik team
answered on 23 Nov 2020, 10:54 AM

Hi Dimitris,

The first question was already answered here :

https://www.telerik.com/forums/kendo-angular-grid----how-to-export-the-entire-records-to-excel-instead-of-page-level

As for the allPages PDF option, exporting to Excel follow different mechanism and logic. By default, the Grid exports its current data.  To export all data to excel please check this article:

https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#exporting-specific-data

I hope this helps.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Dimitris
Top achievements
Rank 1
Veteran
Answers by
Dimitris
Top achievements
Rank 1
Veteran
Martin Bechev
Telerik team
Share this question
or