Set occurrences for a record

You can define how many child records are printed for each master record.

When fetching the children of a master record, you may have data that ends up fetching many, many records. Depending on the needs of your report, you may not need all of the child records printed. You can define the desired behavior with the Occurrences property in the .4rd file.
Figure: Report: number of rows to print

Report Business Record diagram highlighting the Occurrences property
Important: In order for this property to affect the printing of lines, the children must be ordered. See Order records in the Business Records diagram.
Table 1. Occurrences property options
Option Description
1

The master record prints, and only the first fetched child record prints. All other child records are discarded.

If no child rows are fetched, a child row still must print. In Java, C#, and PHP, the defaultValue property of the field is used to create the child row; if defaultValue is not set, the row will be an empty child record. In Swift, defaultValue is ignored and the row will be an empty child record by default.

You can add default values for the row using the computeFields() function. In the <POINT> tag of the computeFields() function, you must test whether the row has data. Test the primary key for NULL or empty if it is a STRING type. Test for zero if it is a numeric type, such as a SERIAL.

0 or 1

The master record prints, and only the first fetched child record prints. All other child records are discarded.

If no child rows are fetched, nothing is printed for the child record.

0 or more

The master record prints, and all fetched child records print, whether it be one child record or many child records.

If no child rows are fetched, nothing is printed for the child record.

1 or more

The master record prints, and all fetched child records print, whether it be one child record or many child records.

If no child rows are fetched, a child row still must print. In Java, C#, and PHP, the defaultValue property of the field is used to create the child row; if defaultValue is not set, the row will be an empty child record. In Swift, defaultValue is ignored and the row will be an empty child record by default.

You can add default values for the row using the computeFields() function. In the <POINT> tag of the computeFields() function, you must test whether the row has data. Test the primary key for NULL or empty if it is a STRING type. Test for zero if it is a numeric type, such as a SERIAL.