Check if data column contains specified value

Stimulsoft Reports.JS discussion
Post Reply
jaqb
Posts: 23
Joined: Thu Jul 25, 2024 7:09 am

Check if data column contains specified value

Post by jaqb »

Hi,
Is it possible to check if data column contains specifed value? I need to add condition for displaying text field, based on whether the data that I've received from the server contains object with specifed string property.
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: Check if data column contains specified value

Post by Lech Kulikowski »

Hello,

You can use the following expression:
{datasourceName.ColumnName.Contains("value)}

Thank you.
jaqb
Posts: 23
Joined: Thu Jul 25, 2024 7:09 am

Re: Check if data column contains specified value

Post by jaqb »

Unfortunately, it does not work as I excepted. I've attached sample files where I have report with 4 gray shapes and I want to make specifed shape green if it exists in the data column. All 4 shapes exist in the data column but only first (circle) is taken into account.
Attachments
data.json
(252 Bytes) Downloaded 197 times
contains_condition.mrt
(4.74 KiB) Downloaded 209 times
contains.png
contains.png (79.99 KiB) Viewed 1985 times
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: Check if data column contains specified value

Post by Lech Kulikowski »

Hello,

The result is correct. If you don't use DataBand, the source.column expression returns only the first record from the source.

Thank you.
Attachments
contains_condition.mrt
(6.81 KiB) Downloaded 189 times
Post Reply