Summary: | Error evaluating formulas with more of 30 arguments on excel file 2007 or major. | ||
---|---|---|---|
Product: | POI | Reporter: | Floriano <florianogiambelli> |
Component: | SS Common | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chiaramarcheschi, lucamartini |
Priority: | P2 | ||
Version: | 3.15-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Floriano
2017-07-05 14:58:52 UTC
Floriano - would you be in a position to submit a patch? org.apache.poi.ss.SpreadsheetVersion has the operand count as a param - 30 for Excel97 and 255 for Excel2007. So maybe the fix is to ensure that this gets used instead of using a separate constant. Passing a SpreadsheetVersion around in all these function APIs looks like it will be a big change. I think we might need to use a ThreadLocal, similar to LocaleUtil. Is it really so bad to just use the larger version constant in formula calculation? Are there cases where we really _need_ to throw an error or stop processing arguments after 30 for older workbooks? Could we just note in the docs that using a formula call with > 30 arguments and then saving in the older format would cause problems when opening in Excel? Greg - that seems like a pragmatic solution - we should just change to this: private static final int DEFAULT_MAX_NUM_OPERANDS = SpreadsheetVersion.EXCEL2007.getMaxFunctionArgs(); I accidentally committed the change to increase the limit to 255 operands in https://svn.apache.org/viewvc?view=revision&revision=1800949 - I will add some test cases tomorrow. This is resolved as far as I see. |