1

I am using POI-HSSF to export some data to excel. Requirement is I need to keep data type of each column. I can keep data type for string and numeric values but not the date. I studied in POI documentation that it supports only 3 basic data types string, numeric and boolean.

Can anyone please tell me how can I keep the 'Date' data type when exporting to excel?

StoopidDonut
  • 8,547
  • 2
  • 33
  • 51

1 Answers1

1

You can look up DateUtil offered by poi.

The way you check for String, numeric and boolean data types, you can use isCellDateFormatted the same was and get the date cell value (getDateCellValue) - which you can keep, reformat or use them in your customized way.

StoopidDonut
  • 8,547
  • 2
  • 33
  • 51
  • Can you please share the detail of dll and its version you are refering – user3480558 Apr 01 '14 at 12:36
  • It would be appreciated if you could some example for .net C# as I am newbie for NPOI – user3480558 Apr 01 '14 at 12:37
  • @user3480558 it wasn't clear from the question which language and library you were referring to. I'd suggest you open a new question with proper C# and npoi tags to get the relevant response. – StoopidDonut Apr 01 '14 at 18:08