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

Ability to remove or set Sheet Dimension <dimension> element #1463

Closed
Josh-Weston opened this issue Feb 3, 2023 · 3 comments · Fixed by #1467
Closed

Ability to remove or set Sheet Dimension <dimension> element #1463

Josh-Weston opened this issue Feb 3, 2023 · 3 comments · Fixed by #1467
Labels
enhancement New feature or request

Comments

@Josh-Weston
Copy link
Contributor

  • Excel automatically adds and updates a <dimension ref="A1:C4"></dimension> when saving a workbook
  • Excelize does not update the <dimension> element (which is fine); however,
  • The <dimension> element will become incorrect as you make changes using Excelize
  • This becomes problematic because some software (e.g., Power BI) uses the <dimension> element (if present) to determine the UsedRange of the sheet when importing rows.

I suggest adding a new method to allow the user to:

  1. remove the <dimension> element entirely if not needed
  2. set the <dimension> element if needed

Example:

func (f *File) SetSheetDimension(dimension string) error

  • if dimension is an empty string, then remove the <dimension> element entirely
  • if dimension is not an empty string then set the <dimension> element
  • returning an error is only required if the function will perform validation checks on the dimension argument; otherwise, it can be omitted from the function signature

References to <dimension> element in this package and others:

@xuri
Copy link
Member

xuri commented Feb 4, 2023

Thanks for your issue. I will adding this feature support in the future.

@xuri xuri added the enhancement New feature or request label Feb 4, 2023
@Josh-Weston
Copy link
Contributor Author

Excellent. Do you want me to work on a pull request?

@xuri
Copy link
Member

xuri commented Feb 5, 2023

Contributions are welcome. I'll certainly accept the pull request if anybody did that.

@xuri xuri linked a pull request Feb 11, 2023 that will close this issue
10 tasks
xuri pushed a commit that referenced this issue Feb 11, 2023
xuri pushed a commit to JDavidVR/excelize that referenced this issue Jul 11, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants