Replace characters with Line feeds

Stimulsoft Reports.NET discussion
Post Reply
Necro
Posts: 1
Joined: Fri Nov 25, 2011 5:36 pm
Location: Mexico

Replace characters with Line feeds

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Replace characters with Line feeds

Post by Alex K. »

Hello,

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

Thank you.
roomy
Posts: 61
Joined: Mon May 06, 2013 12:34 pm

Re: Replace characters with Line feeds

Post by roomy »

I have the same issue when I use replace function it does't work.

{Replace(Table2.desc,"\n"," ")}
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Replace characters with Line feeds

Post 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.
roomy
Posts: 61
Joined: Mon May 06, 2013 12:34 pm

Re: Replace characters with Line feeds

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Replace characters with Line feeds

Post 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.
Post Reply