Exporting data table returns 17-10-2018 but expecting 17-Oct-2018 same as shown in excel.

Hi,

Myself Feroz, currently I am trying to process an excel sheet that has the date column. I am expecting it to return as '17-Oct-2018' but it is returning as '17-10-2018' 
tried using  
worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ComputedFormulaValues);

is there any way to get it directly from syncfusion?



1 Reply 1 reply marked as answer

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team May 26, 2021 01:28 PM UTC

Hi Mohammed, 

Greetings from Syncfusion. 

While exporting the worksheet to a data table, cell values can be exported only with the actual cell value without custom number format. So, date values are exported with a default date format. To get the display text as an expected result while exporting to data table, we suggest you set the number format of the cell as text and enter the date value. 

We have prepared a simple sample for your reference and the same can be downloaded from the below link. 

In the input Excel file used in above sample, we have set  

  1. Custom number format “d-mmm-yyyy” in A1 and set the value as “17-Oct-2018”
  2. Text number format in A2 and set the value as “17-Oct-2018”.

Kindly execute the sample to see the difference and understand the scenarios. Kindly let us know if the provided sample helps. 

Regards, 
Keerthi. 


Marked as answer
Loader.
Up arrow icon