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

Hide header/footer when exporting to PDF?

4 Answers 944 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 19 Nov 2014, 09:19 PM
Is there any way that you can exclude the toolbars with the export buttons and the message about dragging columns to group, and footer/pager from the PDF when exporting the grid? See the attached PDF screen shot for an example.

Frank Wanicka

4 Answers, 1 is accepted

Sort by
0
Accepted
Mihai
Telerik team
answered on 20 Nov 2014, 04:14 PM
Hi,

Not currently, but I just pushed a small new feature that should help.  It will be available in the next internal build.

During PDF export, the toplevel DOM element will get the CSS class "k-pdf-export", and thus you can use plain CSS to exclude elements of your choice.  For example to exclude the grid toolbar and group header you would add this CSS to your page:

      .k-pdf-export .k-grid-toolbar,
      .k-pdf-export .k-grouping-header {
        display: none;
      }

You can use the DOM Inspector to figure out the classes of the elements that you want to exclude.

Again, you will be able to use this feature after downloading the next internal build.  We normally release builds on Fridays.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Frank
Top achievements
Rank 1
answered on 20 Nov 2014, 04:34 PM
Excellent. Thanks very much.
0
William
Top achievements
Rank 1
answered on 27 Feb 2016, 03:10 PM

That works great but I can't seem to get the footer to go away. Here is what I have:

 

<style>
    .k-pdf-export .k-grid-toolbar, .k-pdf-export .k-grid-footer,
      .k-pdf-export .k-grouping-header {
        display: none;
      }
</style>
0
Mihai
Telerik team
answered on 29 Feb 2016, 08:23 AM
Hi,

Use .k-pdf-export .k-grid-pager to target the footer element in PDF.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Frank
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Frank
Top achievements
Rank 1
William
Top achievements
Rank 1
Share this question
or