Language:


Adding a Secondary Register - Linking the Primary and Secondary Registers

When you first add a secondary register to the report, its entire contents will be in the current selection for that register. Therefore, if the report is left as it is now, it will follow this pattern:
Customer 1
All Invoices in the database
Customer 2
All Invoices in the database
Customer 3
All Invoices in the database
After each Customer is printed in the report, the current selection of Invoices (i.e. all Invoices) is printed. The next step is to reduce the current selection of Invoices to those Invoices made out to the Customer on the line above (the current Customer). This is the result being aimed for:
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
To achieve this, you need to search for Invoices whose Customer Number is the same as the Contact Number of the current Customer. Follow these steps:
  1. Click on the line in the report display area marked "Register: Invoices..." to signify that the search is to be carried out in the Invoice register.

  2. Click the [Selection] button. The 'Selection' dialogue box opens. Complete it as shown below:

    Enter "CustCode" as the Field Name, or choose it using 'Paste Special'. This is the internal name for the Customer Number field in the Invoice register.

    Then enter "vrContact.Code" as the Formula.

    This expression refers to the Contact Number field in the Contact register. The expression is in two parts: the first part ("vrContact") is the name of the variable containing the Contact register. This name was given to the variable in the 'Register' dialogue box as described here. The second part ("Code") is the internal name for the Contact Number field in the Contact register. The two parts are separated by a full stop. The expression is case sensitive, so you must use "Code" and not "code". This expression therefore means "the Contact Number of the Contact record that is currently in the vrContact variable" i.e. "the Contact Number of the current Contact".

    Acting together, the Field Name and the Formula state that there will be a search in the Customer Number field in the Invoice register for Invoices whose Customer Number is the same as the Contact Number of the current Contact. Invoices that meet this condition will be printed in the report.

    There is no need to enter an Input Label, Variable Name or Paste Register, because there is no need to place a variable in the specification window as the search will be automatic. Leaving the Input Label empty will mean that the v measurement will be set to zero automatically when you close the 'Selection' dialogue box for the first time. This confirms that no variable will be placed in the specification window.

  1. Click the [OK] button. A new "Selection:" line representing the search is added to the Invoice register section in the report display area:

Please click the links below for more details about: