Click here to Skip to main content
12,403,535 members (71,688 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 2:53am
Hesha778
Updated 16-Aug-12 10:40am
v3
Comments
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
 
good
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!
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 16 Aug 2012
Copyright © CodeProject, 1999-2016
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