Click here to Skip to main content
11,920,641 members (55,712 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET RDL
Hi i just want to created a RDLC report and i want to remove "\n" (newline constraint) from the string i got from database. then i wrote a Expression in the RDLC to remove it as follows

=First(Fields!conAddress.Value, "HAWBDt").ToString().Replace("\n"," ")

but it didn't worked.

the String i got form the database as follows and i want to remove that "\n" from the String.

2nd FloorHolden House,\n57 Rathbone Place,\nLondon,\nUK

if anyone could help me on this matter that would be a great help to me.thanks in advance!!!

Posted 16-Aug-12 3:53am
Edited 16-Aug-12 11:40am
Wes Aday 16-Aug-12 8:58am
It did not work because you are trying to get rid of a newline and it's a slash and an n in the string (not a newline).
Hesha 16-Aug-12 9:02am
yes.Agree.that's why i just put replace("\n", " ") so it should be replace? isn't it?
Wes Aday 16-Aug-12 9:07am
No! That is replacing the newline "\n". It is not a newline in your string is it? try \\n

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try escaping the slash because you really mean a backslash in this case:
=First(Fields!conAddress.Value, "HAWBDt").ToString().Replace("\\n"," ")
Good luck!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 415
1 phil.o 170
2 Dave Kreskowiak 155
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web04 | 2.8.151120.1 | Last Updated 16 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100