poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Woolsey <greg.wool...@gmail.com>
Subject DataTables and formula evaluation
Date Fri, 09 Jun 2017 23:42:23 GMT
POI doesn't currently support "data table" formulas (a variation on array
formulas).  However, the implementation of XSSFCell.isFormulaCell() still
thinks the "master" cell for a data table is a formula type cell.  But the
formula is not a stored one, but implied by the definition of a data table
and it's parameters.  Thus getCellFormula() returns an empty string, which
doesn't parse as a valid formula.

I think isFormulaCell() should just not consider these as formula cells
until POI supports data table formulas.  Currently saying they are formulas
but not actually figuring out what that formula is doesn't make sense.

Anyone think of a case this would be bad?  It should only affect data table
master cells, changing the current expression from:

if (_cell.getF() != null
      || getSheet().isCellInArrayFormulaContext(this))

to

if ( (_cell.isSetF() && _cell.getF().getT() != STCellFormulaType.DATA_TABLE
)
       || getSheet().isCellInArrayFormulaContext(this))

doesn't break anything for me.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message