Set occurrences for a record

You can define how many rows are printed for each record.

Note:

The Occurrences property is available only in business records for reports (.4rd files), not for forms (.4fd* files) or web services (.4ws or .4wsj files).

When fetching the rows of a master record, you may have data that ends up fetching many records. Depending on the needs of your report, you may not need all of the rows 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 rows must be ordered. Go to Order records in the Business Records diagram.

Table 1. Occurrences property options
Option Description
1

The master record prints, and only the first fetched row prints. All other rows are discarded.

If no rows are fetched, a row still must print. By default, it will be an empty row.

You can add default values for the row using an OnComputedFields code event. Select the On Computed Fields property for the creation of the event. In the code event function you will need to test if the row has data. Test the primary key for NULL for a STRING type, or for zero if it is a numeric type, such as a SERIAL.You can add default values for the row using the OnComputedFields function. In the <POINT> tag of the onComputedFields() 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 row prints. All other rows are discarded.

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

0 or more

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

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

1 or more

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

If no rows are fetched, a row still must print. By default, it will be an empty row.

You can add default values for the row using an OnComputedFields code event. Select the On Computed Fields property for the creation of the event. In the code event function you will need to test if the row has data. Test the primary key for NULL for a STRING type, or for zero if it is a numeric type, such as a SERIAL.You can add default values for the row using the OnComputedFields function. In the <POINT> tag of the onComputedFields() 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.