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

Preserve spaces #450

Closed
guillaume-goulet opened this issue Jul 15, 2024 · 0 comments · Fixed by #475
Closed

Preserve spaces #450

guillaume-goulet opened this issue Jul 15, 2024 · 0 comments · Fixed by #475

Comments

@guillaume-goulet
Copy link

Hello,

Context

Currently org.dhatim.fastexcel.StringCache hardcodes the value of each t tag.
It means we cannot customise the attribute of this tag. By default, Excel trims the text values and we need to add the property xml:space="preserve" in order to not trim the text.

Example

sheet.value(0, "\nmy\nvalue\n") will be exported in a correct format but as soon as the file is opened by Excel with default settings the value will be equal to "my\nvalue"

Suggestion

You could add a boolean property to the org.dhatim.fastexcel.StringCache class
And update the write method to set the t tag with the correct attribute (<t xml:space="preserve">)
If it makes senses a customise attribute list could be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant