Page 1 of 1

IIF function

Posted: Wed Mar 15, 2023 8:39 am
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!

Re: IIF function

Posted: Thu Mar 16, 2023 6:54 pm
by Lech Kulikowski
Hello,

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

Thank you.