Language:


Registers

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 records in the Customer 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. The report loops only 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 Customer register. For each Customer record, it then loops through the Invoice register to find Invoices belonging to that Customer. Here the Customer 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 final 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 Customer 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.