Page 1 of 1

Replace characters with Line feeds

Posted: Fri Nov 25, 2011 5:39 pm
by Necro
Hello

I`m trying to create a function, that replaces a substring of characters, with a line feed, so I can display a multiline field in the report. I have created something like this:

Public Sub Text98__GetValue(ByVal sender As Object, ByVal e As Stimulsoft.Report.Events.StiGetValueEventArgs)
cEnter = Chr(13) & Chr(10)
e.Value = ToString(sender, Stimulsoft.Report.Dictionary.StiFunctionsStrings.Replace("hola//mundo","//",cEnter, true))
End Sub


The problem is, that it displays:

hola"&Microsoft.VisualBasic.ChrW(13)mundo

As it not replacing with the chr(30) and chr(10) characters that makes the enter. Any suggest?

Regards.

Replace characters with Line feeds

Posted: Mon Nov 28, 2011 3:44 am
by Alex K.
Hello,

Can you please send us a sample which reproduces the issue for analysis.

Thank you.

Re: Replace characters with Line feeds

Posted: Tue Nov 12, 2013 5:05 am
by roomy
I have the same issue when I use replace function it does't work.

{Replace(Table2.desc,"\n"," ")}

Re: Replace characters with Line feeds

Posted: Tue Nov 12, 2013 11:13 am
by HighAley
Hello.

Please, try to use next expression:

Code: Select all

{Replace(TextBoxControl1.Text,"\r\n"," ")}
If it doesn't help, send us a report template with sample data which reproduces the issue.

Thank you.

Re: Replace characters with Line feeds

Posted: Wed Nov 20, 2013 10:53 am
by roomy
I want to put that in expression where bind datacolum to textcontrol. Can I replace \n from Datatable column and assigne to text control.

Re: Replace characters with Line feeds

Posted: Thu Nov 21, 2013 10:28 am
by HighAley
Hello.
roomy wrote:I want to put that in expression where bind datacolum to textcontrol. Can I replace \n from Datatable column and assigne to text control.
Yes, you can set your data column as the first argument of the Replace function.

Thank you.