Unplanned
Last Updated: 21 Jan 2020 11:51 by ADMIN
Pavel
Created on: 27 Jan 2015 10:32
Category: Grid
Type: Feature Request
24
Add the grid column template to be used when exporting to PDF or Excel
It would be nice to have the possibility of using own template for the exported data, as some data may be obtained from own functions.
Something like this:
            columns: [
                {
                    field: "ProductName",
                    title: "Product Name",
                    aggregates: ["count"],
                    footerTemplate: "Total Count: #=count#",
                    groupFooterTemplate: "Count: #=count#"
                },
                {
                    field: "UnitPrice",
                    title: "Unit Price",
                    template: '<div style="text-align: right; font-weight: bold;">#= kendo.toString(UnitPrice, "n2") #</div>',
                    exportTemplate: '#= kendo.toString(UnitPrice, "n4") #',
                    aggregates: ["sum"]
                }
            ]
2 comments
ADMIN
Alex Hajigeorgieva
Posted on: 21 Jan 2020 11:51

Hello,

The templates are not exported at the moment because they may contain arbitrary content which could break the generated workbook.

We have added a knowledge base article that shows how to export a grid with HTML and many template columns in Excel here:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-export-arbitrary-column-templates

As far as the PDF export is concerned, the k-pdf-class which is added only during PDF export can be used to customize the appearance of columns:

https://docs.telerik.com/kendo-ui/framework/drawing/pdf-output/custom-appearance#using-the

Regards,
Alex Hajigeorgieva
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.
ADMIN
Telerik Admin
Posted on: 27 Jan 2015 13:00
Thanks for the suggestion.

For now you can intercept the excelExport event of the grid as illustrated here (http://docs.telerik.com/kendo-ui/web/grid/how-to/excel/column-template-export) in order to output and format the data in the template column cells according to your preferences