Monday, March 19, 2012

Line Break formatting

I have a report with a narrow column. The column contains a comma delimited number list.

If the length of the string exceeds the width of the column then the line breaks. No problem with this, except that there are breaks between the numbers.

Example:

123,124,125,126

can be formatted as

123,12
4, 125,1
26

I'd like to force a break at a position within the string if its on the comma. Any thoughts on doing this in the Expressions window?

TIA

anyone please?|||you'll need to have space after the commas.|||

By assuming that all your number list of three digits than we can adjust the column width such that it fixes the numbers. if numbers are not fixed length digits than i wont think we can do .

|||The numbers can be any length (1 to n digits). They are also not always guaranteed to be numeric; they can be alphanumeric as well (but still sequential).|||Use vbcrlf. I'm putting a line break in my address with the below code. I tried \r\n, <br>, all kinds of stuff. vbcrlf is what I needed.

=Fields!SHIPTO.Value & vbcrlf & Fields!SHP_TO_CTY.Value & ", " & Fields!SHP_TO_ST.Value & " " & Fields!SHP_TO_ZIP.Value
|||vbcrlf will work but seeing as we're in the .NET world now I would recommend using Environment.NewLine

No comments:

Post a Comment