Page 1 of 1

Multiline cell

Posted: Tue Dec 08, 2015 3:25 pm
by Noemie
Dear all,

I try to set the string value of a cell on multiple lines. For this I use "#13+#10" caractères (CR/LF) This way :

Code: Select all

XLSReadWriteII51[0].AsString[Col,Row]:='TEST'+#13+#10+'TEST 2';
XLSReadWriteII51[0].Rows[Row].Height:=4000;
When I open the xlsx file, the data are in one line "TESTTEST 2"
But as soon as I double click on the cell, the data goes in edit mode and without doing anything, they appears on 2 lines

What can I do on my Delphi code for this problem to be solved?

THanks a lot

Noémie

Re: Multiline cell

Posted: Wed Dec 09, 2015 12:50 pm
by larsa
Hello

1. Use only carriage return.
2. Set WrapText := True

Example:

Code: Select all

XLS[0].AsString[1,1] := 'Hello' + #13 + 'kitty';
XLS[0].Cell[1,1].WrapText := True;

Re: Multiline cell

Posted: Wed Dec 09, 2015 1:00 pm
by Noemie
Dear Larsa,

It's working great,

Thanks for your answer.

Noémie