Opened 2 years ago

Closed 2 years ago

#2177 closed enhancement (fixed)

Better handling of Excel files with formula errors

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.15.1
Component: core Version:
Keywords: Cc:


Formula evaluation is enabled by default when parsing Excel files. But the Apache POI library doesn't support all functions that Excel has. Also, if LibreOffice is the source of the document, there are even more functions that are not supported. For example, I had a file with =CONCAT(...) and got:

Error message 	Error evaluating cell Sheet1!D3
Stacktrace org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue( net.sf.basedb.util.excel.XlsxToCsvUtil$SheetInfo.getCellValueAsString( net.sf.basedb.util.excel.XlsxToCsvUtil$SheetInfo.parseToBytes( net.sf.basedb.util.excel.XlsxToCsvUtil$SheetInfo.parseToCsv( net.sf.basedb.util.parser.FlatFileParser.setInputStream( org.apache.jsp.common.plugin.parse_005ffile_jsp._jspService(

In this case the workaround was to use =CONCATENATE(...) instead.

On the other hand, it would be nice if a formula error doesn't cause the entire parsing to fail, but only displays an error message in the cell. For example, #NAME? (as LibreOffice does).

Change History (1)

comment:1 Changed 2 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

In 7709:

Fixes #2177: Better handling of Excel files with formula errors

This should fix the problem with errors. If the error is due to a missing function we also try to output some information about this. It can probably be improved to cover more cases, but cells with an error should no longer crash the entire import.

Note: See TracTickets for help on using tickets.