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

Date formatting issues in exported child grids

2 Answers 450 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Harper
Top achievements
Rank 1
Harper asked on 26 Sep 2017, 04:15 PM

I'm using a variation on the code from this article to export master and child grids into a single Excel worksheet. I've got the data exporting correctly, but there are two date fields that are showing up in the JSON date format - /Date(1498107600000)/. I'm having trouble finding any documentation on how to correct this. I've tried the following:

var exporter = new kendo.ExcelExporter({
      columns: [{
          field: "Name"
      }, {
          field: "Result"
      }, {
          field: "DateCompleted", title: "Date Completed", format: "dd/MM/yyyy"
      }, {
          field: "DateReceived", title: "Date Received", format: "dd/MM/yyyy"
      }],
      dataSource: dataSource
  });

 

Where is this breaking down?

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 28 Sep 2017, 10:13 AM
Hello, Harper,

When the dates have to be exported to Excel I can suggest formatting the cell as demonstrated in the following article:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/cell-format#set-cell-format-during-excel-export

The same approach is working with the dates in the provided format "/Date(1498107600000)/":

https://dojo.telerik.com/iyuFA

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Harper
Top achievements
Rank 1
answered on 28 Sep 2017, 06:50 PM

Stefan,

   That helped. I didn't have the "model" element defined under the "schema". Adding that solved the issue. 

Thanks,

Harper

Tags
Grid
Asked by
Harper
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Harper
Top achievements
Rank 1
Share this question
or