Ming Huang
Ming Huang

Reputation: 1370

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.

Upvotes: 1

Views: 462

Answers (2)

Wisely Wong
Wisely Wong

Reputation: 380

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),"")

Upvotes: 1

John Cappelletti
John Cappelletti

Reputation: 81970

Perhaps you have char(13) and/or char(10) in your data.

Replace(Replace(Concat(loc.Address1,' ',loc.Address2,' ',loc.City,', ',loc.State),char(10),''),char(13),'') AS FullAddress

Upvotes: 1

Related Questions