How to convert boolean fileds to custom template while doing export excel using kendo ui grid

2 posts, 0 answers
  1. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 30 Mar 2016 Link to this post


    I'm customizing the boolean fields using template option in kendo column configuration and its working fine.but while doing export excel custom template is getting converted to boolean.

    example  :  im having status column of type boolean/number,using template im displaying status as (Active/Inactive/pending).when i do export excel it is displaying as true/false in excel sheet.

    Here is the example code with boolean type:

                        type: "boolean", sortable: false, field: "isPublished", title: "Publish Status", filterable: false,
                        template: "<label class=\"action-status#=isPublished#\">#= (isPublished == false) ? 'NOT PUBLISHED' : 'PUBLISHED' #</label>", width: "150px"

    example code with number type:


                function parseDataForKendo(result) {
                    var data = [];
                    productionScheduleListVm.scheduleList = result.results;
                    var results = result.results;
                    for (var i = 0; i < results.length; i++) {
                        var schedule = {
                            status: results[i].schedule ? results[i].schedule.status : 0,
                            scheduleStatusClass: results[i].schedule.status ? resolveScheduleStatusCssClass(results[i].schedule.status) : null,
                            scheduleStatusText: results[i].schedule.status ? resolveScheduleStatusText(results[i].schedule.status) : null,
                    return { "results": data, "totalResults": result.totalResults };

    column config:

                        type: "number", sortable: true, hideWhenMinimize: true, field: "status", title: "Status", filterable: { cell: { template: statusFilter, showOperators: false }},
                        template: "<label class=\"schedule#=scheduleStatusClass# scheduleLabel\">#= (status == null) ? '-NA-' : scheduleStatusText# </label>"


  2. Rosen
    Rosen avatar
    3253 posts

    Posted 01 Apr 2016 Link to this post


    Indeed, as mentioned in the documentation, the column templates are not exported to excel. In case you want to show just a custom text you may follow the link in the documentation to this how-to article which demonstrate how to achieve such functionality. 

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top