Time format doesn't same when exporting excel from data grid

1 Answer 122 Views
Grid
Jaeyeon
Top achievements
Rank 1
Jaeyeon asked on 27 Sep 2022, 01:35 AM

When I tried to export excel, the data format changed.

For example, the data that is seen in the browser looks like this: 01:01:30 

However, checking the excel after export, the time shows like this: 3690, which is seconds.

How can I get the same format in the browser and in excel?

Thanks.

{
			field: "cn_busy_grp",
			title: "통화시간",
			columns :[{
				field: "ts_busy_times",
				title: "총통화시간",
				template: '#=convertSecondsToString(ts_busy_times, "hms")#',
				footerTemplate: '#=convertSecondsToString(sum, "hms")#',
				groupFooterTemplate: '#=convertSecondsToString(sum, "hms")#',
				width: "80px"
			},


1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 29 Sep 2022, 09:36 AM

Hello Jaeyeon,

This is due to the fact that the Excel export engine uses the actual values which columns are bound to. However, this can be overcome with custom logic in the excelExport event handler. Please check out the following article showing this in a runnable example:

https://docs.telerik.com/kendo-ui/knowledge-base/column-template-export

Hope this helps.

Regards,


Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Jaeyeon
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or