Closed Antonio225t closed 7 months ago
I came to fix it. When writing a line break (at least for LibreOffice Calc works like this, no idea if it's the same for Excel) add Format::new().set_text_wrap();
or add .set_text_wrap()
to your format. Hope this helps.
I came to fix it.
Yes. That is the correct way (as required by Excel). See the docs for Format::new().set_text_wrap()
:
https://docs.rs/rust_xlsxwriter/latest/rust_xlsxwriter/struct.Format.html#method.set_text_wrap
See the docs for Format::new().set_text_wrap()
Ahh there. Thanks for the information 😄
Current behavior
I used
worksheet.write_string_with_format(2, 2, "Hello\nWorld", &format)?;
but the line break doesn't show and when I edit the cell in LibreOffice Calc to add the line break manually, it does add the line break but for some reason the last letter gets ereased, it shows like this:And after I edit manually:
(I'm sorry but I cannot test on Excel because I don't have it installed.)
Expected behavior
I expect that the xlsx cell that I want to add a line break looks like this:
Sample code to reproduce
Any other information
No response