Howto concat fields in Text expression

Stimulsoft Reports.WEB discussion
Post Reply
florian
Posts: 10
Joined: Fri Jan 13, 2017 4:05 pm

Howto concat fields in Text expression

Post by florian »

I'd like to concat several source fields into one Text.Text expression. The expression I use is

Code: Select all

{string.Join(" / ", new []{ source.Field1, source.Field2, ... }.Where(x => x != null)}
or simplified to reproduce:

Code: Select all

{string.Join(" / ", new []{"A", null}.Where(x => x != null)}
but get the error

Code: Select all

The error of compilation is found in the 'Text' property of the 'Text23' component: } expected
Is there any way to escape the sequence or archive the concatination?
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Howto concat fields in Text expression

Post by Lech Kulikowski »

Hello,

Unfortunately, it is not possible with standard functions.

You can implement and add to the Dictionary your own function for that task.

Thank you.
florian
Posts: 10
Joined: Fri Jan 13, 2017 4:05 pm

Re: Howto concat fields in Text expression

Post by florian »

OK, thank you. I'll implement a custom function for this.
Max Shamanov
Posts: 767
Joined: Tue Sep 07, 2021 10:11 am

Re: Howto concat fields in Text expression

Post by Max Shamanov »

Hello,

You are welcome!
Post Reply