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
Line breaks are not supported (Excel Mac 2011) #252
Comments
I am running into this issue as well. |
@niallsmart I rolled back to the merge fix #127 and your test case still doesn't work. I am also on Mac 2011.. perhaps this never worked? |
You have to use shared strings to make multiline strings work correctly (don’t ask me why …). Just add the following line to your test case: package.use_shared_strings = true |
@noniq good to know, thanks. |
@niallsmart - Maybe a silly question, but how did you figure that out? What are the best resources for understanding how to get microsoft excel to do what you want? Seems very challenging to say the least. thx! |
Are you referring to the use of shared strings? I found that out by comparing an file created by Excel itself (linebreaks working) with the one written by Axlsx (linebreaks not working) – the only difference I noticed was that Excel’s file used shared strings. I think it’s just a bug in Excel 2011 for Mac that it seems to not support linebreaks in files without shared strings. I guess all versions of Excel (maybe Open Office, too?) always create files with shared strings, so the bug only shows when opening files created with tools like Axlsx. |
@noniq - How do you go about that comparison when axlsx generates a binary file? Also, what does "shared strings" refer to? thx! |
@kbaum well, I was not actually the person who figured that out :) Personally I have found StackOverflow and the discussions on GitHub to be useful for debugging problems. Shared strings is a reference to the package level setting referred to in an earlier comment on this issue. |
Right.. i get that it's a setting.. but beyond that, what does it mean? |
@kbaum it's a technique used to reduce file size by storing references to commonly used strings in a table, instead of repeating them inline. you can find more information here: http://msdn.microsoft.com/en-us/library/office/gg278314.aspx |
@kbaum xlsx files are in a format called Office Open XML (OOXML) – that means they are in fact just a ZIP file containing a bunch of XML files. You can change the extension from For more info about OOXML see https://en.wikipedia.org/wiki/Office_Open_XML |
@noniq - wow.. that is super helpful. Thanks for your help! |
@kbaum @niallsmart To round this up: Can you confirm that multiline strings in Excel 2011 Mac work correctly for both of you if the file is written with |
@noniq - yes.. use_shared_strings = true did the trick! |
Summary: This appears to be a bug in Excel Mac 2011, |
did anyone find this created a very very wide column? |
Adding this style will add new line to cell. I tried it in Mac OSX 10.11.4 |
In case you use |
Axlsx 2.0.1 does not support line breaks in cells, as tested in Excel Mac 2011.
Test case is here:
https://gist.github.com/niallsmart/6878157
The text was updated successfully, but these errors were encountered: