Date format issue in telerik export

1 Answer 21 Views
General Discussions Report Designer - Web Report Designer (standalone) Report Viewer - WinForms
sujith
Top achievements
Rank 1
sujith asked on 28 Feb 2025, 11:57 AM

Hi,

Iam exporting date column values e.g. 23/11/2023 using Telerik to an .xlsx excel file.

From exported excel, if you right click the value -> Choose Format cell, it is showing as General

How can this be shown as Date.  What changes to make in Telerik file before exporting.

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 05 Mar 2025, 11:49 AM

Hi Sujith,

Could you please provide more details about the issue you are experiencing? When you mentioned that the default formatting is set to "General", does this mean you are seeing the date displayed incorrectly in the XLSX file? For instance, is it showing up as a number instead of in the date format?

That being said, I attempted to reproduce this issue by adding a SqlDataSource component to the report and setting the Format property for the text box that displays the date:

As a result, the dates were rendered in the correct format in the XLSX file:

And the "Format Cells" option indicated a Custom format being applied:

Once again, I would greatly appreciate it if you could provide more details about the issue you are experiencing. Additionally, it would be very helpful if you could share a sample report file that demonstrates the problem so I can investigate it locally. Thank you!

Regards,
Petar
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

sujith
Top achievements
Rank 1
commented on 06 Mar 2025, 11:40 AM

Hi Petar, Thank you for your reply.

I was looking for Category -> Date like below. 

Petar
Telerik team
commented on 10 Mar 2025, 04:45 PM

Hello Sujith,

Thank you for the clarification.

You can achieve this behavior by using the device information setting called UseExtendedFormatting for XLSX rendering. By default, it is set to True to preserve the data being affected by culture-specific settings. However, you can set it to False through the extensions element of the report engine configuration. If you haven't already, you can look at the following documentation article on how to set it up:

Once you have the configuration applied, if you use a standard DateTime format string for the Format property of the corresponding text box containing the dates, such as {0:d}:

If you follow the above steps, you should be able to see the correct format being applied by default:

I hope this helps. Please let me know if you need any further assistance regarding this matter.

Regards,
Petar
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
General Discussions Report Designer - Web Report Designer (standalone) Report Viewer - WinForms
Asked by
sujith
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or