Hello,
In a report that I am working on I have a string field coming in from a web service data source that has carriage returns and line feeds in it.
I would like to remove those \r\n instances and have a single line for my string field.
6 Answers, 1 is accepted

Terribly sorry, didn't mean to post then.
For example:
data comes in as :
"Test Field: answer
Another Test Field: another answer"
but I would rather have it formatted as :
"Test Field: answer Another Test Field: another answer"
Is there a way to format my text this way?
Hi Ezra,
You can try to concatenate the strings. For example:
= "Test field: " + Fields.[Test Field] + " Another test field: " + Fields.[Another Test Field]
Please, check the attached report for further reference and let me know if that's the desired outcome.
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hello Neli,

That was a mistake.
So, the field that I am receiving from my datasource is a string that comes in as this:
"Test Field: Answer\r\nAnother Test Field: Another Answer\r\nYet Another Test Field: Yet Another Answer"
And then when I use it in a report item it is automatically formatted as
"Test Field: Answer
Another Test Field: Another Answer
Yet Another Test Field: Yet Another Answer"
And attempting to use Replace(__, "\r\n", "") does not work.
What I would like is to format the string as:
"Test Field: Answer Another Test Field: Another Answer Yet Another Test Field: Yet Another Answer"
Hi, Ezra
So the newline '/r/n' gets parsed and saved in a different way once brought into the report.
A solution to removing these spaces once the data is inside the report is to use the Replace function. For the data-source, create a new Calculated Field where we replace the newline with one space like shown in this screenshot
You can see how the function in the expression has an actual linebreak as part of its first parameter.
I hope this information solves your issue. Let me know if it did, if you run into challenges, or have any other questions.
Regards, Mads Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hello Mads,
This solution works great! Thank you for the help!