-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9028: force recalculate formula fields #16352
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
DYN-9028: force recalculate formula fields #16352
Conversation
- requests full calculation when opening the excel file after writing it with Dynamo OpenXML
stylesheet.NumberingFormats can be null, this prevents from null exception to happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9028
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that Excel formula fields are recalculated when the file is opened and adds a null‐safe check for numbering formats when formatting cell values.
- Forces full recalculation of formulas on load
- Adds null check around
stylesheet.NumberingFormatsto avoid NRE - Returns unformatted value string if no numbering format is found
Reviewed Changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| OpenXmlHelper.cs (Write method) | Appends CalculationProperties and sets FullCalculationOnLoad = true to force formula recalculation |
| OpenXmlHelper.cs (GetCellValue block) | Uses null‐safe access (?.ElementAt) on NumberingFormats and early returns unformatted string when missing |
jasonstratton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you.
zeusongit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purpose
This PR follows the issue discussed here: https://jira.autodesk.com/browse/DYN-9028 - Formulas breaking (not recomputing) after exporting new data using OpenXML node to an existing Excel with Formula
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
stylesheet.NumberingFormatsisnullReviewers
@jasonstratton
@zeusongit
@achintyabhat
FYIs
@reddyashish