Ming Huang Ming Huang - 1 year ago 73
SQL Question

concatenating fields with no line break in SSRS

I want to concatenate couple fields into one line using expression in SSRS

=Fields!Address1.Value & Fields!Address2.Value +" " + Fields!City.Value + " " + Fields!State.Value

But all the fields have a line break. It is driving me nuts. I need to get rid of the line break.

I also tried this in my query:

Concat(loc.Address1, loc.Address2,loc.City, loc.State) AS FullAddress

Still won't work.

Answer Source

Use this in your expression: This is to replace char(10) (also known as vblf line break) with empty string "". It should get you the result.

Replace(Fields!Address1.Value & Fields!Address2.Value +" " + Fields!City.Value + " " + Fields!State.Value),char(10),"")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download