Expression compare with null

Stimulsoft Reports.JS discussion
Post Reply
jimyWeb
Posts: 42
Joined: Wed Feb 03, 2016 8:08 am

Expression compare with null

Post by jimyWeb »

Hello,
I have the next expression:
{(listadoHYG_cabecera.fechaFactura == null) ? listadoHYG_cabecera.fechaInicioFmto+" - "+listadoHYG_cabecera.fechaFinFmto: listadoHYG_cabecera.fechaFactura}
I need compare the field fechaFactura with null, but it doesn`t work. The field fechaFactura contains null. How should I use the comparison operator?
Thank you!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Expression compare with null

Post by HighAley »

Hello.

What type of datasource do you use?
Usually, the null values are converted to empty string.

Thank you.
jimyWeb
Posts: 42
Joined: Wed Feb 03, 2016 8:08 am

Re: Expression compare with null

Post by jimyWeb »

I use JSON datasource.
I compared it with an empty string and it works. Thank you.

Solution:
{(listadoHYG_cabecera.fechaFactura == "") ? listadoHYG_cabecera.fechaInicioFmto+" - "+listadoHYG_cabecera.fechaFinFmto: listadoHYG_cabecera.fechaFactura}
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Expression compare with null

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need our help.

Thank you.
Post Reply