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";
}
}
},
.......................................................
.......................................................