Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 20th, 2014, 02:47 PM
Registered User
Join Date: Mar 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default OfficeOpenXML and Line Breaks in Cell

Hi, I am changing code from using a htmlTextWriter to generate an excel document(2010) from a dataset to using the OfficeOpenXML object. The old code had a pipe-delimited string that had the pipes replaced to put in a <br> tag. This produced a line break in a single cell (like using alt+enter). I am trying to do the same thing using the OpenOfficeXML ExcelStyle objects, but I am struggling. Does anyone know how to do this? I tried Char(10), Char(13), \r, \n, etc...Nothing works so far..

I want to do something like this:
cell.Value = value.ToString().Replace("|", "<Br>");
Old March 20th, 2014, 03:08 PM
Registered User
Join Date: Mar 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Figured it out...

I needed: style.WrapText = true;

Similar Threads
Thread Thread Starter Forum Replies Last Post
line breaks mister_mister XSLT 14 March 17th, 2008 12:55 PM
Line Breaks in Access? chroniclemaster1 Access 0 February 13th, 2008 04:55 AM
How to do line breaks! Apocolypse2005 Beginning VB 6 2 December 11th, 2006 03:20 PM
Line breaks question gkirk Beginning PHP 2 February 27th, 2005 10:40 AM
Want to detect line breaks conundrum Classic ASP Basics 1 October 3rd, 2003 04:05 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.