Jai Gtz
Jai Gtz

Reputation: 65

Kendo Export to Excel with custom

I can create kendo grid export to excel with no problem. The problem is this, i want to customize that excel format to behave something like this.

http://jsfiddle.net/zvjy5cxL/2/

<u><b>Custom Header</b></u>

As far as i know, Kendo only can export in the grid only. So is there any ways to insert or append that custom into the grid so when generate excel it will include that custom together.

Upvotes: 0

Views: 3082

Answers (1)

Oggy
Oggy

Reputation: 1666

You can handle the excelExport event of the grid and make modifications to the excel file before it gets sent for download. In your case you can add something like this to your grid's configuration:

  excelExport: function(e) {
    var rows = e.workbook.sheets[0].rows;
    rows.unshift({
        cells: [ { value: "Custom Header", bold: true, underline: true } ]
    });
  }

There is a working example here: http://dojo.telerik.com/uqado And you can see what options you have with regards to formatting your header's text inside the spreadsheet here: http://docs.telerik.com/kendo-ui/framework/excel/appearance

Upvotes: 2

Related Questions