Multiline cell

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Noemie
Posts: 8
Joined: Wed Mar 24, 2010 10:04 am

Multiline cell

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Multiline cell

Post 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;
Lars Arvidsson, Axolot Data
Noemie
Posts: 8
Joined: Wed Mar 24, 2010 10:04 am

Re: Multiline cell

Post by Noemie »

Dear Larsa,

It's working great,

Thanks for your answer.

Noémie
Post Reply