Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.104.1 #368

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Update to 0.104.1 #368

wants to merge 3 commits into from

Conversation

jahav
Copy link
Member

@jahav jahav commented Oct 11, 2024

I am updating ClosedXML.Report because 0.104.1 was released.

A lot of unit tests is failing, mostly because I modified how defined names are working and I am slowly moving away from automagic that shifts everythign based on ranges.

I will fix tests one by one and familiarize myself with the codebase.

This is the first commit, so I can try to fix the rest. It compiles and test fail.
The test failed, because some subtotals didn't have correct address.

The root cause was the ShiftFormula and ExpandFormula methods. They
adjusted only references in a range form ((e.g. `SUBTOTAL(9,I41:I61)`),
not single cell form (e.g. `SUBTOTAL(9, I41)`).

The condition was added in Initial commit 7 years ago, so it likely
isn't needed anymore (regex seems to find references). By removing the
redundant condition, test passes.
The test was failing for two reasons:

The template contained a <definedName name="Table1Range">
'Sheet 1'!#REF!</definedName> and when ClosedXML.Report tried to shift
the range, a range is shiften, it failed because setter
XLDefinedName.ReferesTo tried to extract references from that formula
(=no valid references). That was propagated to
FormulaReferences.ForFormula where parser reported an empty formula
error.

That is a ClosedXML error, XLDefinedName.RefersTo setter shouldn't try
to get references for empty formula.

The second problem was in the Gauges file. It contained formulas that
had area form (SUBTOTAL(9,I41:I41)) depsite being single cell
(SUBTOTAL(9,I41:I41)). Formulas thus weren't equal and test failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant