We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Add break line in an Excel Cell

Thread ID:

Created:

Updated:

Platform:

Replies:

74165 Jun 2,2008 10:59 AM Jun 4,2008 01:38 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Pierre-Alain Galtier
Asked On June 2, 2008 10:59 AM

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


Dhivya K [Syncfusion]
Replied On June 4, 2008 01:38 AM

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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;