Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to remove new line...
Finance forum
Suggested answer

How to remove new line using replace function in SSRS

Posted on by

The temp db table DP class has line like this

mytmptable.CompanyAddress= strReplace(mytmptable.CompanyAddress, "\n", "\n\n");

So the report is having spacing due to above command.

How to reverse that logic using SSRS Replace function i tried the following but it did not help.

Replace(First(Fields!CompanyAddress.Value,"mytmptable"),Chr(10),", ")

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: How to remove new line using replace function in SSRS

    Are you sure you can't handle it in the dataset using extensions? You could hook in the insert method of the temp table and remove newlines from this field. Right? Of course I haven't seen the ISV code, but perhaps you can share it if my suggestion is not feasible.

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: How to remove new line using replace function in SSRS

    Hi Mav,

    Then.

    Have you ever tried Regex? 

    There may be more than one. Replacement cannot simply implement it.

    https://www.experts-exchange.com/questions/23593454/SSRS-removes-spaces-and-line-breaks-from-single-field-report.html

    https://stackoverflow.com/questions/40613205/remove-blank-lines-from-string-ssrs

  • Mav Profile Picture
    Mav on at
    RE: How to remove new line using replace function in SSRS

    No its not in dataset it is a ISV report so the DP in ISV model has a line of code where it is replacing "/n" with "/n/n"

    The ISV DP for this report is not extensible as I wasnt able to undo the above line of code using the COC.

    Hence trying to do via SSRS. Only if in SSRS there could be a way to find  "chr(10)chr(10)" & replace with "chr(10)"

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: How to remove new line using replace function in SSRS

    Hi Mav,

    Does your CompanyAddress field have a newline character in itself?

    Why don't you try to remove it from the data set?

  • Mav Profile Picture
    Mav on at
    RE: How to remove new line using replace function in SSRS

    Any one any solution for this.

    How to find  "chr(10)chr(10)" & replace with "chr(10)" in SSRS

  • Mav Profile Picture
    Mav on at
    RE: How to remove new line using replace function in SSRS

    Already tried that it is the 1st internet search for replacing new line , it does not work in my case.

    What is required to fix this is how to find "\n\n"  or "Chr(10) Chr(10)" in a string  & replace with single Chr(10) in SSRS.

  • Mav Profile Picture
    Mav on at
    RE: How to remove new line using replace function in SSRS

    Already tried that it is the 1st internet search for replacing new line , it does not work in my case.

    What is required to fix this is how to find "\n\n"  or "Chr(10) Chr(10)" in a string  & replace with single Chr(10) in SSRS.

  • Satish Panwar Profile Picture
    Satish Panwar 14,639 on at
    RE: How to remove new line using replace function in SSRS

    Take a look at link below

    stoneridgesoftware.com/.../

    They seems to have issues in first place and are using code what you have above.. and then there is alternate trick. See if this helps.

  • Mav Profile Picture
    Mav on at
    RE: How to remove new line using replace function in SSRS

    I cant reverse it & hence I am asking a question about how to reverse it using SSRS replace .

  • Satish Panwar Profile Picture
    Satish Panwar 14,639 on at
    RE: How to remove new line using replace function in SSRS

    If you can reverse it... can't you comment that "\n\n" in first place

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans