Meaningless Drivel is fun!*
The moose likes Other Open Source Projects and the fly likes POI Dataformat not applied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "POI Dataformat not applied" Watch "POI Dataformat not applied" New topic
Author

POI Dataformat not applied

Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi All,
I am using POI to create Excel sheets. Here while creating the cell, I apply the necessary styles for which I applied the dataformat. The excel gets generated fine but I am not seeing the format in the generated sheet.

Please see the sample code below



The excel sheet should display the as "31-Jul-08 22:12" but I could see only "7/31/2008 10:12:43 PM".

Any help on this is very much appreciated.


Regards,
Sivaraman.L
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Don't use setCellValue(String), use setCellValue(Date).

That's demonstrated at http://poi.apache.org/hssf/quick-guide.html#CreateDateCells


Ping & DNS - updated with new look and Ping home screen widget
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi Ulf,
Thanks a ton. I was breaking my head all day for this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: POI Dataformat not applied
 
Similar Threads
I want to read datas from excel sheet
display of japanese characters in Excel report
How to sort the excel sheet using POI?
xlxs extention does not support
Help with Dataformats in Excel using Apache POI