views:

19

answers:

0

Hi, I am using HSSF-POI(3.2) for writing an Excel file(2003). The structure of a row is: DATE_COL1, NUM_COL1, DATE_COL2, DATE_COL3, DATE_COL4, NUM_COL2; DATE_COLs and NUM_COLs are formatted as dates and numerics respectively. While creating the sheet I dynamically set the formats and the data too, which gets set correctly. On editing this sheet in Excel, when I delete the data in NUM_COL2 and then re-enter a value, that value is rendered in the Date format. If I enter a new value in NUM_COL2 without deleting no change in format happens.

I also noticed in Excel 2003 when you have a structure like so:DATE_COL1, NUM_COL1, DATE_COL2, DATE_COL3, NUM_COL2; DATE_COLs and NUM_COLs are formatted as dates and general/default respectively. When a value is entered into the NUM_COL2 it is rendered as a Date. However if the NUM_COLs are formatted as 'Number' Excel doesnt behave as above.

Is this an issue with POI, Excel or implementation? How can I persist the numeric formatting?

Thanks!