View Issue Details

IDProjectCategoryView StatusLast Update
0033393FPCPackagespublic2018-03-19 08:52
ReporterStephanoAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033393: fpreport (feature request): Add IsNull function to detect NULL fields
DescriptionIt is currently impossible to determine if a field is null. Instead it is just set to 0 or ''. This is bad especially for dates.
Can an IsNull property be added to the TFPReportDataField class, and an IsNull built-in function defined to be able to detect null values?
TagsNo tags attached.
Fixed in Revision38562.
FPCOldBugId0
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2018-03-18 13:02

administrator   ~0107235

Added a
Function FieldIsNull(S : String) : Boolean
function. You need to pass the name of the field as a string, not the field value itself. (Expression parser does not have support for Null values)

Stephano

2018-03-18 18:45

developer   ~0107244

Last edited: 2018-03-19 08:07

View 3 revisions

You implemented exactly what is required. +1
However FieldIsNull gives true for any field value. Test file uploaded.

Edit: FieldIsNull appears in the Built-in variables list instead of the functions list

Stephano

2018-03-18 18:45

developer  

FieldIsNullBug.json (8,668 bytes)

Michael Van Canneyt

2018-03-19 08:40

administrator   ~0107248

Last edited: 2018-03-19 08:41

View 2 revisions

You must read my remark :)

The following is wrong:
[FieldIsNull(Data1.F1)]

The correct way is:

[FieldIsNull('Data1.F1')]

You must pass the name, not the value. That is why it is called FieldIsNull(), because you must pass the name of the field. see my remark :)

If ever the expression parser allows Null values then I can Implement IsNull(), which accepts a value, and then you willl be able to write

[IsNull(Data1.F1)]

What concerns the location of this function: I am aware of that, but currently I have no other way of showing this. I must still think about how to solve this.

Stephano

2018-03-19 08:52

developer   ~0107249

I did read you remark, but i completely misinterpreted it :)

Issue History

Date Modified Username Field Change
2018-03-09 08:28 Stephano New Issue
2018-03-09 08:28 Stephano Status new => assigned
2018-03-09 08:28 Stephano Assigned To => Michael Van Canneyt
2018-03-18 13:02 Michael Van Canneyt Fixed in Revision => 38562.
2018-03-18 13:02 Michael Van Canneyt Note Added: 0107235
2018-03-18 13:02 Michael Van Canneyt Status assigned => resolved
2018-03-18 13:02 Michael Van Canneyt Fixed in Version => 3.1.1
2018-03-18 13:02 Michael Van Canneyt Resolution open => fixed
2018-03-18 13:02 Michael Van Canneyt Target Version => 3.2.0
2018-03-18 18:45 Stephano Note Added: 0107244
2018-03-18 18:45 Stephano Status resolved => feedback
2018-03-18 18:45 Stephano Resolution fixed => reopened
2018-03-18 18:45 Stephano File Added: FieldIsNullBug.json
2018-03-18 18:46 Stephano Note Edited: 0107244 View Revisions
2018-03-19 08:07 Stephano Note Edited: 0107244 View Revisions
2018-03-19 08:40 Michael Van Canneyt Note Added: 0107248
2018-03-19 08:40 Michael Van Canneyt Status feedback => resolved
2018-03-19 08:40 Michael Van Canneyt Resolution reopened => fixed
2018-03-19 08:41 Michael Van Canneyt Note Edited: 0107248 View Revisions
2018-03-19 08:52 Stephano Note Added: 0107249
2018-03-19 08:52 Stephano Status resolved => closed