Checking for empty string from database field

Stimulsoft Reports.PHP discussion
Post Reply
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Checking for empty string from database field

Post by plantant »

In my database a field has an empty string, that content can be accessed via {Supplier_Info.address2}

When there is data, I can check the length like this: {Supplier_Info.address2.Length}, however, when it is an empty string, this does not work. Is there another way to check for empty string?

Im using this in an if statement:
{IIF(Supplier_Info.address2.Length > 0, "", "")}
More text here

If it is blank, it does not continue to print the next line.

The only way I have been able to check for an empty string is like this:
{IIF(Supplier_Info.address2 + " " == " ", "", "")}
More text here

Thanks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Checking for empty string from database field

Post by Vladimir »

Hello,

We have improved the expression parser, now the Length() function and Length method will work properly. Also we have added check for null values. The update will be available in the next prerelease build on February, 8.

Thank you.
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Checking for empty string from database field

Post by plantant »

Great! Thanks for the quick updates. This is a great product and once now that I've gotten the hang of it, it makes things so much easier!

Looking forward to the release,

Danny
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Checking for empty string from database field

Post by Vladimir »

We are always glad to help you!

Thank you.
Post Reply