Add break line in an Excel Cell

Hi,

I would like to have a line break inside a cell.

I tried \n and it works when opening whis OpenOffice but not when opening with Excel 2007.

Have you got a solution for me ?

Thanks a lot


1 Reply

DK Dhivya K Syncfusion Team June 4, 2008 05:38 AM UTC

Hi Christophe,

Thank you for your interest in Essential XlsIO.

I am able to reproduce the issue. To make line break work for Excel 2007, please set the text wrap for the cell and then break the text as follows:


[C#]
sheet.Range["A1"].CellStyle.WrapText = true;
sheet.Range["A1"].Text = String.Format("Hello\nworld");


Please let me know if this helps.

Regards,
Dhivya.


Loader.
Up arrow icon