How about a toString() for the HSSFCell? public String toString() { switch (getCellType()) { case CELL_TYPE_BLANK: return ""; case CELL_TYPE_BOOLEAN: return getBooleanCellValue()?"True":"False"); case CELL_TYPE_ERROR: return getErrorCellValue() + ""; case CELL_TYPE_FORMULA: return getStringCellValue();//I don't know how to do this??? case CELL_TYPE_NUMERIC: return cell.getNumericCellValue() + ""; case CELL_TYPE_STRING: return cell.getStringCellValue(); default: return "Unknown Cell Type: " + cell.getCellType(); } }
This sounds a lot like the functionality that was requested in Bug 15303. I posted a solution that, but have never heard back. I personally like my solution that was posted on Bug 15303 (but I'm probably bais).
No objection, submit a patch.
Comitted, with some modifications. Thanks. Testcase added. Would have been much faster is there was a testcase along with this.