-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[BUG] Formulae in "Formatting Rules" throws exception #2311
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
Comments
This is solved? |
Has the problem been solved? |
bug seams to persist:
|
In the above pr I have a very simple fix if you want to point to that branch in your package.json. You can install it using this command. |
Thank you! For now I apply a similar patch with diff --git a/lib/xlsx/xform/sheet/cf/cf-rule-xform.js b/lib/xlsx/xform/sheet/cf/cf-rule-xform.js
index 22b3e44ecc8731a3a04bac22d43f32c4211dfbe3..95208161a56e98b6ba49ba9dee8524c8051c1d0a 100644
--- a/lib/xlsx/xform/sheet/cf/cf-rule-xform.js
+++ b/lib/xlsx/xform/sheet/cf/cf-rule-xform.js
@@ -155,7 +155,7 @@ class CfRuleXform extends CompositeXform {
priority: model.priority,
});
- this.formulaXform.render(xmlStream, model.formulae[0]);
+ this.formulaXform.render(xmlStream, model.formulae?.[0]);
xmlStream.closeNode();
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
If a formatting rule is setup for a sheet, that references another sheet, an exception is thrown when you call

XLSX.writeBuffer
Cell
model
looks like this:Exception:
Lib version: 4.3.0
Steps To Reproduce
sample.xlsx
The expected behaviour:
The conditional formatting is applied.
Possible solution (optional, but very helpful):
In
/lib/xlsx/xform/sheet/cf/cf-rule-xform.js
, this code could be patched to not assume formulae is set:The text was updated successfully, but these errors were encountered: