Bug 55668

Summary: nullPointerException when using setCellType(Cell.CELL_TYPE_STRING) when the cell have an expression with empty result
Product: POI Reporter: Ghaleb <ghaleb>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Try to convert all cells to String using cell.setCellType(Cell.CELL_TYPE_STRING);

Description Ghaleb 2013-10-18 11:20:42 UTC
Steps:
open excel
write an expression inside the cell
the cell result should be empty (null in POI HSSF workbook)
save as xls file

Read the file using POI and try to convert it to String by using setCellType(Cell.CELL_TYPE_STRING)

--
the cell have a value of:
=IF('Q:\Comune\A&O division\SALES\GRIGLIE\CALCULATIONS\AIR EXPORT\[GRID COSTI.xlsx]FreightOS'!A758="","",'Q:\Comune\A&O division\SALES\GRIGLIE\CALCULATIONS\AIR EXPORT\[GRID COSTI.xlsx]FreightOS'!A758)

And the result(or the cached value is blank)
Comment 1 Dominik Stadler 2013-11-02 20:43:53 UTC
Can you please attach a test-xls-file which has this setup to allow to reproduce the problem easily?
Comment 2 Ghaleb 2013-11-03 12:08:53 UTC
Created attachment 31003 [details]
Try to convert all cells to String using cell.setCellType(Cell.CELL_TYPE_STRING);
Comment 3 Dominik Stadler 2016-03-13 21:34:12 UTC
Should be fixed via r1734861, in this case we now set the cell to type BLANK to reflect that it actually has no value.