IIF function

Stimulsoft Reports.WEB discussion
Post Reply
DanielSiegers
Posts: 1
Joined: Wed Mar 15, 2023 8:31 am

IIF function

Post by DanielSiegers »

Hello

We used to have stimulsoft reports.net, but recently purchased the latest version of reports.web.
All our reports are build in the .net version, so i'm testing if everything is working alright.

The problem i have is with the IIF function.
I have this in a text field:

{DataSource3.unitamount} {DataSource3.unitid} {DataSource3.productid}
{IIF(DataSource3.weight == null, "", DataSource3.weight + " kg")} {IIF(DataSource3.loadingmeter == null, "", DataSource3.loadingmeter + " lm")}

This does not work as i want it to, i only want to show the text " kg" and " lm" when the fields are NOT empty, but when i preview the report, i see the text " kg" and " lm" on lines where these fields are empty.

In the old .net version it was as follows:
{DataSource3.unitamount} {DataSource3.unitid} {DataSource3.productid}
{IIF(IsNull(DataSource3,DataSource3.weight),"",DataSource3.weight + " kg")} , {IIF(IsNull(DataSource3,DataSource3.loadingmeter),"",DataSource3.loadingmeter + " lm")}

But this also does not work.

How can i get it to work so it only shows the text kg and lm when there is a value in the fields.

Thanks in advance!
Attachments
report1.PNG
report1.PNG (5.21 KiB) Viewed 693 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: IIF function

Post by Lech Kulikowski »

Hello,

Please clarify what data source and "weight" column types in your report.

Thank you.
Post Reply