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

Alignment cannot be used with a created cell format. #305

Closed
DevonReynolds opened this issue Dec 12, 2024 · 3 comments
Closed

Alignment cannot be used with a created cell format. #305

DevonReynolds opened this issue Dec 12, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request resolved This issue has been resolved.

Comments

@DevonReynolds
Copy link

DevonReynolds commented Dec 12, 2024

In the styles.xml, excel seems to expect it to be alignment then protection. With the creation of a new cell format it always creates the protection which will always put it before the alignment. If I change the code to force create the alignment before it creates the protection in the create method it "fixes" it but I don't' think that's the correct approach.

What excel expects
image

What openXLSX creates
image

In the demo10.cpp file, the cell format is copied from a cell that doesn't have a format. This bug doesn't effect the format when created this way.

@aral-matrix
Copy link
Collaborator

Your title is not entirely clear - am I understanding correct that you have the same issue here where Excel complains about the sequence of XML tags, like in the borders issue #304?
I really want to do something painful to the responsible Microsoft "developers". This has "intentionally breaking compatibility" written all over it.

@aral-matrix
Copy link
Collaborator

as per #304, I have (hopefully) fixed this today with 77f4370 and would appreciate some testing.

@aral-matrix aral-matrix added enhancement New feature or request testing Functionality has been implemented in development branch and is pending a merge into main ready to close Pull request has been answered or implemented & is pending closure labels Dec 19, 2024
@aral-matrix
Copy link
Collaborator

Patch has been merged into master. Please report any other such issues you may find where MS Office complains about a "wrong" sequence of XML tags.

@aral-matrix aral-matrix added resolved This issue has been resolved. and removed testing Functionality has been implemented in development branch and is pending a merge into main ready to close Pull request has been answered or implemented & is pending closure labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resolved This issue has been resolved.
Projects
None yet
Development

No branches or pull requests

2 participants