-
Notifications
You must be signed in to change notification settings - Fork 807
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
Using ClosedXML, mixed font style in cell is lost #1330
Comments
Hi, Your input file contains an interesting case: inline mixed-style content. How was this generated in the first place? I've never seen it. Unfortunately ClosedXML doesn't support this yet, but we can add it. At the moment normal and mixed-styles are supported for shared strings and only normal (non-mixed) inline strings are supported. We'll add it to our to-do list. Thanks for filling out the issue template well. |
Hi, and thanks for your reply. |
So I'm guessing that you don't really care whether the strings are stored in the shared string part or whether they're inline, right? If you don't care, the easy solution is that ClosedXML just always saves rich text content as shared strings. @Pankraty ? |
Yeah, honestly I don't really care how the document is formatted internally as long as it works 😅️ and thanks again for your quick responses and support, you guys are awesome |
@igitur I don't see reasons against. |
Do you want to request a feature or report a bug?
Version of ClosedXML
Tested both 0.94.2 and 0.95.0-beta2
What is the current behavior?
I have an XLSX file (attached as test.xlsx) that has a cell with mixed font inside it (cell A1). As you can see, the cell has some words in different font styles/colors:
If I open and save this file using ClosedXML (even without doing anything else), the mixed formatting is lost:
As you can see, weirdly, the entire cell seems to acquire the style of the first piece of text (bold font in this case)
What is the expected behavior or new feature?
Cell styles should not be modified (especially since I didn't even do any modifications to the document, just opened and closed it)
Reproducibility
I just opened and then saved the document with ClosedXML, like this:
Further info
By having a look manually at the files inside the XLSX archive before and after saving it with ClosedXML, it seems it is "merging" various
<r>
elements, each one with its own style, into a single element without the style, as shown here:The text was updated successfully, but these errors were encountered: