I'm trying to use POI to format some date values in a spreadsheet. I need to get the date format in just month/day format (without the year). I've been trying to do that with the following code:
HSSFCellStyle normalStyle = project.WorkBook.createCellStyle();
HSSFFont normal = project.WorkBook.createFont();
normalStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d")); // normalStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy")); normalStyle.setFont(normal);
Whenever I use the given code I don't get the expected results in the created spreadsheet. The spreadsheet just shows a number, which varies depending on the specified date, but is always incorrect and NOT formatted as a date. If I use the commented line of code then things work properly, but it messes up the on-screen formatting of my spreadsheet as the column widths don't fit the year specification.
I'd appreciate it if someone could help out with this issue. I can provide some screenshots or other details if necessary.
Thanks for your help. Alex.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
