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

kendo Ui grid with angular Js-Changing date format for excel Export column

1 Answer 422 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 12 Jan 2016, 07:11 AM

Hello..

Not able to change the format of date column for the exported excel file using angular js and kendo ui grid.The below code works but date format is not as is in the customized format.could any one Please let me know how to customize the format(MMM d,yyyy) of the date cells while exprting to excel.

Html is defined as  <div kendo-grid="statmentsGrid" k-options="gridCapOptions"> and the 

Controller code goes as follows

 $scope.gridCapOptions = {
            dataSource: {
                transport: {
                    read: function (options) {
                        accountStatementResource.capTrans({
                            transit: $userService.Transit                         
                        }, function (result) {
                            vm.capTrans = result;
                            options.success(result);
                            $scope.height = "auto";
                            /* next line for on demand loading of kendo grid */
                            vm.optionCallbackTwo = options;
                        }, function (err) {
                        });
                    }
                },
                pageSize: 5,
                aggregate: [{ field: "EndingBalance", aggregate: "sum" }]
            },            
            toolbar: ["excel"],
            excelExport: function (e) {
                var sheet = e.workbook.sheets[0];
                for (var rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
                    var row = sheet.rows[rowIndex];
                    for (var cellIndex = 0; cellIndex <2; cellIndex++) {
                        row.cells[cellIndex].format = "MMM d, yyyy";
                    }
                }               

            },
           .......................................................

           .......................................................

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 13 Jan 2016, 12:23 PM

Hello Manoj,

I am unable to reproduce the behavior on my end. Here is an example that demonstrates the export in action. Could you modify it or send a separate runnable example to demonstrate the problem?

Regards,
Dimiter Madjarov
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
Manoj
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or