Aspose export datatable date format

Hello

We are currently facing a problem when opening an excel file with the aspose.cells library.

This excel file contains some date values that can have any date format (dd/mm/yyyy in French, mm/dd/yy in English by example).

We are then exporting this excel file to a datatable using the ExportDatatableAsString function.

Our problem is that each date value is automatically modified according to the browser language.

By example :

- Our date value is : 12/03/2014 ( French Format )

- The browser language is : EN

- When exporting to the datatable, the value is automatically modified to “3/12/14”

What we want is to read and export the date values as they are in the excel file without modification of format.

We are only having the problem with xlsx files, not with xls files.

Is there a way to export the excel file to a datatable and to keep the date format of the excel file ?


/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi,

Could you download and try our latest fix/version: Aspose.Cells for .NET 7.7.2.3 if it makes any difference.

If you still find the issue, kindly paste your sample code (runnable) and attach your template Excel file(s), we will check your issue soon.

Thank you.

We still have the same problem with the latest version.

What’s more, we have the problem with the date format dd/mm/yyyy that has an asterisk in Excel ( Excel explains that format beginning with an asterisk respond to changes in regional date and time settings.

We would like to use this format anyway but without getting the date modified when exporting to datatable.

I’ll try to send you a sample and the template Excel.


Hi,

Thanks for using Aspose.Cells.

If you wants to get the formatted value with specific regional settings (such as French), you should set the region for Workbook (Workbook.Settings.Region) firstly then export the datatable. Otherwise regional settings of the thread or system default will be used to format values and it depends on the environment where the application are running.