Word Report Carriage return issue using asp.nethttp://forums.asp.net/t/1684304.aspx/1?Word+Report+Carriage+return+issue+using+asp+netSat, 28 May 2011 11:32:24 -040016843044433648http://forums.asp.net/p/1684304/4433648.aspx/1?Word+Report+Carriage+return+issue+using+asp+netWord Report Carriage return issue using asp.net <p>I am generating report in word(i.e) I am exporting all the data from the database and replacing it in with the placeholder in the word document.</p> <p>While the data is being retrieved from the database if the data contains any enter or new line character it retrieves it with the boxes and hence it replaces the string in the word with boxes such as for eg. abc and then box icon and then xyz&nbsp;on other line for</p> <p>abc</p> <p>xyz</p> <p>text.how can i eliminate the box icon and still display the data&nbsp;as above?</p> <p>I have tried replacing the character using chr(11), chr(13), system.newline etc but the box icon still exists? Is there any other way i can perform the above task?</p> 2011-05-26T11:52:55-04:004436095http://forums.asp.net/p/1684304/4436095.aspx/1?Re+Word+Report+Carriage+return+issue+using+asp+netRe: Word Report Carriage return issue using asp.net <p>You can remove all the chr(13) and chr(11) using a regular expression replacement:</p> <pre class="prettyprint">Dim s = &quot;abc&quot; &amp; vbCrLf &amp; &quot;def&quot; Dim t = Regex.Replace(s, &quot;[\r\n]&quot;, &quot;&quot;)</pre> <p><br> - t now contains &quot;abcdef&quot; with no extra characters.<br> <br> (You'll need Imports System.Text.RegularExpressions)<br> <br> HTH,<br> <br> Andrew</p> 2011-05-28T11:32:24-04:00