String Contains

Stimulsoft Reports.NET discussion
Post Reply
AmauryJ
Posts: 6
Joined: Tue Dec 17, 2019 9:02 am

String Contains

Post by AmauryJ »

Hello,

I would like to know if a string value contains chain "test" like this:

IIF (myvalue LIKE '%test%', "contains test", "no contains test").

But it's not work.
Have you got some idea?

Thank in advance

Amaury
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: String Contains

Post by HighAley »

Hello,

What is the report language of your report?
What report engine will you use?
By default, it's C# and you should use C# expressions in the report not SQL.

Code: Select all

myvalue.Contains("test")? "contains test":"no contains test"
Thank you.
AmauryJ
Posts: 6
Joined: Tue Dec 17, 2019 9:02 am

Re: String Contains

Post by AmauryJ »

Hello,

I use Stimulsoft Reports.Net Version 2016.3.1 with .Net Frameword v4.0.30319.
Your solution works perfectly.

Thank you very much for your answer.
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: String Contains

Post by Lech Kulikowski »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply