Open esrieh opened 5 years ago
Most likely this is a shared formula
XSSF has special code to handle this, which basically works by getting the base formula, then shifting it appropriately to the location of the cell
The XSSF code is at https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java#L482 - you'd probably need to implement something similar for the streaming reader too
if I'm not completely wrong, when reading the attached example XLSX File with version 2.10, some (but not all!) of the formulas on first sheet, fetched by StreamingCell.getCellFormula() are returned as zero-length Strings. It seems the formulas are not properly read in each case by the StreamingReader, even if the cell itself gets marked as CellType "formula". In the attached example the formulas at cells B5, A8 and A9 are properly read, the formulas at cell C5, D6 and A10, A11... are not The example implementation (see below) outputs for me (cells B5 and C5):
Example File example.xlsx
Java Code