Click here to Skip to main content
Rate this: bad
good
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
Hesha764
Edited 16-Aug-12 11:40am
v3
Comments
Wes Aday at 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 at 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 at 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
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


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