SSRS Comma Delimited string to display on newline
Asked Answered
E

3

6

I have a Report in SSRS 2008. One of the columns contains a comma delimited set of values. An example cell displays:

Sting1, String2, String3

I would like to display these values in the cell on new lines:

String1
String2
String3

I've tried replacing the "," with "<br/>" and using HTML and then referencing HTML Decode but couldn't manage to get that to work.

I've also tried replacing the "," with "\r\n" and displaying but could not get that to work either.

Any ideas?

Elvaelvah answered 21/7, 2014 at 15:54 Comment(0)
E
11

Found an answer. In the Expression for the TextBox for the cell in the Tablix:

=Fields!YourColumn.Value.ToString().Replace(",",vbCrLf)

The VB Carriage Return Line Feed displays the values on separate lines

Elvaelvah answered 21/7, 2014 at 17:45 Comment(0)
D
0

Try: =(Split(Fields!YourColumn.Value, ","))

Dozen answered 21/7, 2014 at 16:19 Comment(1)
@Daniel...thanks for the suggestion...but it returns this error...Warning The Value expression used in textrun ‘Subtasks.Paragraphs[0].TextRuns[0]’ returned a data type that is not valid.Elvaelvah
W
0

You can use an expression to replace commas from line breaks.

=Replace(Fields!YourColumn.Value, ",", vbLF)
Wimsatt answered 6/2 at 4:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.