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

Grid export excel header

7 Answers 1422 Views
Grid
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 25 May 2016, 08:35 AM

Hi Guys,

 

I'm wondering if would be possible to add a title/header to excel exported file from grid.

Something similar to how the export to pdf shows a nice title on top of page.

Is there any way to accomplish this?

 

Cheers!

 

7 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 25 May 2016, 10:52 AM

Hello CORNEL,

You could use the excelExport event handler of the Grid and prepend a row in the exported Workbook. Here is an example of this.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
IT
Top achievements
Rank 1
answered on 25 May 2016, 11:24 AM

Hi Dimiter,

 

Thank you for the prompt reply!

The solution looks intriguing. 

Any pointers how to go about expanding the cell across multiple columns and centering the content to look more like a proper title/header ?

 

Cheers!

0
Accepted
Dimiter Madjarov
Telerik team
answered on 25 May 2016, 12:06 PM

Hello CORNEL,

This could be achieved by further customizing the options of the inserted cell:

http://docs.telerik.com/kendo-ui/api/javascript/ooxml/workbook#configuration-sheets.rows.cells.colSpan

http://docs.telerik.com/kendo-ui/api/javascript/ooxml/workbook#configuration-sheets.rows.cells.textAlign

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
IT
Top achievements
Rank 1
answered on 26 May 2016, 02:36 AM

Hi Dimiter,

 

Thank you very much for the pointers!

It works flawlessly to create an excel report title.

 

Cheers!

0
Dimiter Madjarov
Telerik team
answered on 27 May 2016, 07:13 AM

Hello CORNEL,

Thank you for the update. I am glad the issue is resolved.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
InnovasiTeam
Top achievements
Rank 1
answered on 19 Apr 2017, 06:14 PM
Is there a way to do this for PDF exports, too?
0
Alex Hajigeorgieva
Telerik team
answered on 21 Apr 2017, 12:13 PM
Hello Eric,

You can add a custom header to the PDF exported Kendo UI Grid with the help of  a template as shown in the overview section at:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/pdf-export#page-template

Kind Regards,
Alex Hajigeorgieva
Telerik by Progress
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 (charts) and form elements.
Tags
Grid
Asked by
IT
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
IT
Top achievements
Rank 1
InnovasiTeam
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or