pjfanning / excel-streaming-reader

An easy-to-use implementation of a streaming Excel reader using Apache POI
Apache License 2.0
113 stars 26 forks source link

Read Shared Formulas Bug #252

Closed cnscottluo closed 6 months ago

cnscottluo commented 6 months ago

This is a test file. T2.xlsx

these B23、C23、D23、E23 cell formula is error

18:11:37.488 [main] DEBUG org.apache.poi.openxml4j.opc.PackageRelationshipCollection - Parsing relationship: /xl/_rels/workbook.xml.rels
18:11:37.493 [main] DEBUG org.apache.poi.openxml4j.opc.PackageRelationshipCollection - Parsing relationship: /_rels/.rels
18:11:38.394 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell B11 should have formula SUM(A12:A20) based on shared formula SUM(A12:A20) (rowsToMove=0)
18:11:38.394 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell C11 should have formula SUM(A12:A20) based on shared formula SUM(A12:A20) (rowsToMove=0)
18:11:38.394 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell D11 should have formula SUM(A12:A20) based on shared formula SUM(A12:A20) (rowsToMove=0)
18:11:38.395 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell E11 should have formula SUM(A12:A20) based on shared formula SUM(A12:A20) (rowsToMove=0)
18:11:38.400 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell B23 should have formula A22+A11+A5+A21 based on shared formula A22+A11+A5+A21 (rowsToMove=0)
18:11:38.400 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell C23 should have formula A22+A11+A5+A21 based on shared formula A22+A11+A5+A21 (rowsToMove=0)
18:11:38.400 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell D23 should have formula A22+A11+A5+A21 based on shared formula A22+A11+A5+A21 (rowsToMove=0)
18:11:38.401 [main] DEBUG com.github.pjfanning.xlsx.impl.StreamingRowIterator - cell E23 should have formula A22+A11+A5+A21 based on shared formula A22+A11+A5+A21 (rowsToMove=0)
pjfanning commented 6 months ago

Thanks for reporting this. It does look like the existing code only handles shifting shared formulas based on rows and not columns.

https://github.com/pjfanning/excel-streaming-reader/blob/ab6f1c6f4584f6bf850408e11aca77cbca01f74d/src/main/java/com/github/pjfanning/xlsx/impl/StreamingRowIterator.java#L368

cnscottluo commented 6 months ago

Thanks for reporting this. It does look like the existing code only handles shifting shared formulas based on rows and not columns.

https://github.com/pjfanning/excel-streaming-reader/blob/ab6f1c6f4584f6bf850408e11aca77cbca01f74d/src/main/java/com/github/pjfanning/xlsx/impl/StreamingRowIterator.java#L368 Do you have any plans to repair it? If so, when?

pjfanning commented 6 months ago

see https://github.com/pjfanning/excel-streaming-reader/pull/253

All going well, I can release a new version of the jar in a few days.

cnscottluo commented 6 months ago

see #253

All going well, I can release a new version of the jar in a few days.

Thank you so much!!!

pjfanning commented 6 months ago

v4.3.1 was released