Bug 55668 - nullPointerException when using setCellType(Cell.CELL_TYPE_STRING) when the cell have an expression with empty result
Summary: nullPointerException when using setCellType(Cell.CELL_TYPE_STRING) when the c...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 11:20 UTC by Ghaleb
Modified: 2016-03-13 21:34 UTC (History)
0 users



Attachments
Try to convert all cells to String using cell.setCellType(Cell.CELL_TYPE_STRING); (22.50 KB, application/vnd.ms-excel)
2013-11-03 12:08 UTC, Ghaleb
Details

Note You need to log in before you can comment on or make changes to this bug.
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.