Registers in Reports
This page describes the role of primary and secondary registers in the structure of a report.
---
A report can be based on the contents of a single register or on several registers. For example, a report might list Customers and Invoices. One possible structure for this report is as follows:
- Customer 1
- Customer 2
- Customer 3
- Invoice 1
- Invoice 2
- Invoice 3
This is a simple list where the report first loops through the Customer records in the Contact register and prints them, and then loops through the records in the Invoice register and prints them. There are two separate loops, so both registers are "primary" registers. The primary register is the main register in a loop. A report will only loop once through a primary register.
This is a second possible structure for the report:
- Customer 1
- Customer 1's first Invoice
- Customer 1's second Invoice
- Customer 1's third Invoice
- Customer 2
- Customer 2's first Invoice
- Customer 2's second Invoice
- Customer 2's third Invoice
- Customer 3
- Customer 3's first Invoice
- Customer 3's second Invoice
- Customer 3's third Invoice
In this example, the report loops through the Contact register. For each record in that register representing a Customer, it then loops through the Invoice register to find Invoices belonging to that Customer. Here the Contact register is the primary register, the main register in the loop, and the Invoice register is the secondary register. The report loops through the secondary register once for each record in the primary register.
A tertiary register can be added to this structure:
- Customer 1
- Customer 1's first Invoice
- first partial Receipt against the Invoice
- second partial Receipt against the Invoice
- Customer 1's second Invoice
- Receipt against the Invoice
- Customer 1's third Invoice
- Receipt against the Invoice
- Customer 2
- Customer 2's first Invoice
- first partial Receipt against the Invoice
- second partial Receipt against the Invoice
It should be emphasised that designing a report requires some planning. It can be useful to draw a template of the required output of the report on paper first, to get an idea of the information you want printed and to ensure the report is easy to understand. This process will provide some guidance to help with the logic of the report. For example, a list of Invoices could be based on the Invoice register or the Contact register, depending on how much information you want to show from each register, what search criteria you want to use, and/or what sort order you require.
---
Structure of Report Generator Reports:
Go back to: