Lazarus
Programming => Packages and Libraries => LazReport => Topic started by: runs on March 26, 2023, 01:18:04 pm
-
How could a check whether a field is null in the script section?
I tried [field]= nil but arises an error that nil does not exits. Also try [field].IsNull but an error too.
Thanks.
-
Need more info, preferably code that fails where you expect it to work.
-
Need more info, preferably code that fails where you expect it to work.
for example,
if [DataMod.DsoPrint."Substitute_ID"] = nil then
MmoSubstituted.Visible:=True;
I get an "undefined symbol" error
-
That is not a serious reply.
-
Unfortunately, LazReport converts a database field value from null to an empty string or zero (depending on the field type). Try using the OnGetValue event.
-
Unfortunately, LazReport converts a database field value from null to an empty string or zero (depending on the field type). Try using the OnGetValue event.
Yes, it converts it to an integer, 0 for null. So it is mandatory to check for >0 to not null.
Thanks!