We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Date format not reflecting in Excel out put

Hi

I have Excel Template and am filling the each row in excel by using PUTVALUE method.I applied one of my column format as DATE as "3/14/2001" and getting value from data base as "Mar 14 2010" but in my output excel the format i applied is not displaying

Hi,


Well, I used the following sample code with v7.1.1 and it works fine. Here is my sample code:

Sample code:

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
Cells cells = sheet.Cells;
cells[“A1”].PutValue(“3/14/2010”, true);
//Define a style object adding a new style
//to the collection list.
Style stl5 = cells[“A1”].GetStyle();
//Set custom number format.
stl5.Custom = “MMM dd yyyy”;

cells[“A1”].SetStyle(stl5);

sheet.AutoFitColumn(0);

workbook.Save(“e:\test2\outputDateTimeset.xlsx”);

Please find attached the output file.



Also check the documents for your reference:
http://docs.aspose.com/display/cellsnet/Setting+Display+Formats+of+Numbers++and++Dates
http://docs.aspose.com/display/cellsnet/Formatting+Rows++and++Columns

Thank you.