Monday, March 19, 2012

Line feed problem in HTML

I'm using a string in report which contains chr(10) -> Line feed characters. They show up correctly (there are several lines) in Preview screen and in pdf-format but NOT in browser. I think the browser doesn't understand those characters. Is there a way to replace them somehow with other useful keys? If there is an example would be great...

I use the equivalent of the old vbCrLf i.e. carriage return followed by a line feed, and this works fine in the HTML.

Try using Chr(13) & Chr(10) or the .NET property Environment.NewLine.

For formatting in SQL I use CHAR(13) + CHAR(10)

|||I'm sorry but I didn't get it. I have 3 rows long field in report(Fields!Address.value) and that value contains those carriage returns. So should I edit the expression of the field to find where the carriage returns are and replace them somehow?|||try Replace(Fields!Address.Value, chr(10), Environment.NewLine)

No comments:

Post a Comment