{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Null Behavior - Formula Property

The formula engine of i-net Clear Reports offers different ways to deal with empty database fields.
If a null value occurs there is no "natural" way to continue the calculation. Obviously, an empty field will have no visible effect if used in a simple addition. But how about a division? Here the user has to define which result i-net Clear Reports will prefer.

There are three different types of null treatment:

Continue with null as result

By default, i-net Clear Reports will try to treat null values like a zero or an empty string. I case of an addition for instance, nothing would be added. If there is no reasonable result, the operation will return null as well. Functions will not accept null for parameters. In that case the calculation will be interrupted by an exception.

Examples

  1 + {empty.NumberField} => 1
  1 * {empty.NumberField} => 0
  1 / {empty.NumberField} => nukk
  "abc" + {empty.StringField} => null
  if 1=2 then true => null

Replace null by a default value

If a formula field is set to use defaults, i-net Clear Reports will try to use the default value of the same type as the empty database field, if a null value occurs. If there is for instance an empty STRING field an empty String will be used.

Note: This option is obviously limited to value types, which have a default value. There is no default for dates, arrays or ranges.
The keyword null has no implied type. It cannot be used with this option since it has no default value!

Examples:

  1 + {empty.NumberField} => 1
  1 * {empty.NumberField} => 0
  1 / {empty.NumberField} => div/zero Error
  "abc" + {empty.StringField} => "abc"
  if 1=2 then true => false

Interrupt the calculation on null values

This setting will case i-net Clear Reports to interrupt the calculation of the current formula, if an empty database field was read. In that case the field will have the return value null and will not be displayed, unless the document option "Convert database null values to default" is set.

Examples:

1 + {empty.NumberField} ==> null, not displayed
			 1 * {empty.NumberField} ==> null, not displayed
			 1 / {empty.NumberField} ==> null, not displayed
			 "abc" + {empty.StringField} ==> "null, not displayed
			 if 1=2 then true ==> false

Impact on property formulas

If you use formulas to modify the properties of an report element, it is recommended to use the default setting. i-net Clear Reports uses the properties default value whenever a property formula returns null. This property default might be for instance the setting of a background color chooser. So, if the formula is forced to create a default on null values, this is NOT guaranteed to be the default of the property.
For instance, the default background color might be set to red. So, if the property formula returns null for any reason the background will be red. But, if the formula is forced to create defaults, it will return 0, which is the default for numeric values and will display as black.

i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - Null Behavior