Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Data format in POI

 
Mehul Mistry
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am using POI 3.7 for excel and want to add custom data format to the cell style. The custom type that I am trying to set is date format (dd/mm/yyyy) which is not available in built-in format. There doesn't seem to be any API that can allow setting and retrieving custom date format. All I can do is HSSFDataFormat.getBuiltinFormat(). Is there anyway we can achieve this?

The reason for setting it as cell style is my client want it to be as the data format in the excel. So in the generated .xls file, if he does a right click on the cell containing date, and opens "Format Cells" it should show him as date.

Any help on this will be appreciated. I have been trying this for quite a few days.

Thanks,
Mehul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic