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

Table syntax support for Util.getFormulaCellRefs() #240

Closed
SoltauFintel opened this issue Mar 30, 2023 · 4 comments
Closed

Table syntax support for Util.getFormulaCellRefs() #240

SoltauFintel opened this issue Mar 30, 2023 · 4 comments
Assignees
Milestone

Comments

@SoltauFintel
Copy link
Member

SoltauFintel commented Mar 30, 2023

Using German formula =SUMMEWENNS(AktuellerBestandTabelle[Buchwert_Direkt];AktuellerBestandTabelle[Zinsblock ohne 71_72];WAHR;AktuellerBestandTabelle[Erste Fälligkeit Jahr];0) will result in wrong value 0.

Cause is this code in StandardFormulaProcessor.java:116:

if (isFormulaCellRefsEmpty && isFormulaJointedCellRefsEmpty
   && (!formulaCellData.isParameterizedFormulaCell() || formulaCellData.isJointedFormulaCell())) {
         targetFormulaString = formulaCellData.getDefaultValue() != null ? formulaCellData.getDefaultValue() : "0";
}

isFormulaCellRefsEmpty is true because JXLS doesn't recognize the table syntax (e.g. "AktuellerBestandTabelle[Buchwert_Direkt]") as a cell ref. Util.getFormulaCellRefs returns an empty list.

@SoltauFintel SoltauFintel added the enhancement New feature or request label Mar 30, 2023
@SoltauFintel
Copy link
Member Author

Solution: extend Utl.regexCellRef with + "|[a-zA-Z_]+[a-zA-Z0-9_]*\\[.+\\]". However, many testcases will fail.

SoltauFintel added a commit that referenced this issue Mar 30, 2023
@SoltauFintel SoltauFintel added help wanted Extra attention is needed and removed enhancement New feature or request labels Mar 30, 2023
@leonate
Copy link
Member

leonate commented Apr 7, 2023

Solution: extend Utl.regexCellRef with + "|[a-zA-Z_]+[a-zA-Z0-9_]*\\[.+\\]". However, many testcases will fail.

I added |[a-zA-Z_]+[a-zA-Z0-9_]*\[.+\] to the Util.regexCellRef pattern as you suggested and mvn verify still works fine for me.
So I committed the change to the feature-240 branch.

@SoltauFintel
Copy link
Member Author

Formula "FUNC(a[b],c[d])" does not work. I'm going to push a bugfix.

SoltauFintel added a commit that referenced this issue Jul 7, 2023
- Gradle 7.4.2
- override annotation
@SoltauFintel SoltauFintel self-assigned this May 10, 2024
SoltauFintel added a commit that referenced this issue May 10, 2024
@SoltauFintel
Copy link
Member Author

PR #312 is my 2nd attempt to solve this issue.

SoltauFintel added a commit that referenced this issue May 10, 2024
@SoltauFintel SoltauFintel removed the help wanted Extra attention is needed label May 10, 2024
@SoltauFintel SoltauFintel added this to the 3.1.0 milestone Jul 16, 2024
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

No branches or pull requests

2 participants