Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to remove new line...
Finance forum

How to remove new line using replace function in SSRS

(0) ShareShare
ReportReport
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
    101,158 Moderator 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
    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
    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
    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
    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
    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
    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
    14,653 Moderator 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
    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
    14,653 Moderator 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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,033 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,854 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans