In Excel template we have set column format to custom date ‘yyyy-mm-dd’ and we are expecting same in output file which is of type Csv.
But we are always getting mm/dd/yyyy in output.
Could you let us know why aspose is not picking the date format from excel template.
Attached sample template, actual and expected outpu.
I tested your scenario/case using your template file and following sample code and it works fine. I am using latest version/fix: Aspose.Cells v22.9 (please try it if you are not already using it):
e.g. Sample code:
DataTable t = new DataTable("AA");
DataColumn dc1 = t.Columns.Add("MY_DATE");
//Set its data type.
dc1.DataType = System.Type.GetType("System.DateTime");
//Add a new new record to it.
DataRow row = t.NewRow();
row[0] = DateTime.Now;
t.Rows.Add(row);
//Create WorkbookDesigner object.
WorkbookDesigner designer = new WorkbookDesigner();
//Open the temple Excel file.
designer.Workbook = new Workbook("e:\\test2\\Templ_1.xlsx");
//Set the datasource.
designer.SetDataSource(t);
//Process the markers.
designer.Process();
//Save the Excel file.
designer.Workbook.Save("e:\\test2\\out1.csv", SaveFormat.Csv)
Please find attached the output CSV file for your reference. files1.zip (170 Bytes)
If you still find the issue with latest version/fix, kindly do share sample (runnable) code, we will check it soon.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.