Skip to content

This close #2146, support setting excel custom properties #2147

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mengpromax
Copy link
Contributor

Change-Id: I4a524b494f09fbfca321d515b5029f4f7361311f

PR Details

support setting excel custom properties (actual file in DocProps/custom.xml) to save some biz info like biz version for further uses.

Description

  1. when CreateFile, add custom.xml and save it in .refs by default.
  2. SetCustomProperty can set custom property k:v in custom.xml.

Related Issue

#2146

Motivation and Context

I have a requirement that save some biz k:v data in the generated excel file, before i implent it my program wrote a hidden excel to save some such data.

How Has This Been Tested

  • UT test for custom properties setter and getter
  • Open the generated excel file on my WPS program to check if the custom properties was written

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 28, 2025
Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.23%. Comparing base (5bd9647) to head (eea1d9a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2147    +/-   ##
========================================
  Coverage   99.23%   99.23%            
========================================
  Files          32       33     +1     
  Lines       30273    30393   +120     
========================================
+ Hits        30042    30162   +120     
  Misses        153      153            
  Partials       78       78            
Flag Coverage Δ
unittests 99.23% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mengpromax mengpromax force-pushed the master branch 2 times, most recently from edfc003 to ab0b6f1 Compare May 29, 2025 12:20
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR. I've left some comments.

@mengpromax mengpromax force-pushed the master branch 6 times, most recently from 2990830 to e58fdbc Compare June 2, 2025 08:17
@mengpromax
Copy link
Contributor Author

@xuri hi xuri, i have solved the comments, please take a look again.
I have implemented flaot, datetime, bool and string four custom properties types.

…erties in DocProps/custom.xml)

- support save some biz k:v data to excel custom properties to do such that save excel biz version etc.

Change-Id: I4a524b494f09fbfca321d515b5029f4f7361311f
Signed-off-by: mengzhongyuan <[email protected]>
@mengpromax
Copy link
Contributor Author

@xuri something else should i do before merging this to base?

@xuri
Copy link
Member

xuri commented Jun 9, 2025

No action required, this PR has a lot of code, I need some time to review.

@xuri xuri moved this to Features in Excelize v2.10.0 Jun 9, 2025
@xuri xuri linked an issue Jun 9, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Features
Development

Successfully merging this pull request may close these issues.

support setting excel custom properties (properties in DocProps/custom.xml)
2 participants