Language:

HansaManuals

Creating a Report Using the Report Generator
Creating a Report Generator Report - Specifying the Primary Register
Creating a Report Generator Report - The Appearance of the Report
   - Adding a Report Title
   - Adding Column Headings
   - Adding Fields to the Report
Creating a Report Generator Report - Choosing a Print Destination
Creating a Report Generator Report - The Width of the Report Window
Creating a Report Generator Report - Printing the Report
Creating a Report Generator Report - Adding White Space
Creating a Report Generator Report - Adding Searches
Creating a Report Generator Report - Adding a Secondary Register
Creating a Report Generator Report - Using Variables and Formulae
Creating a Report Generator Report - Printing Information from Matrices
Creating a Report Generator Report - Bringing Information in from Other Registers
   - Linked Registers and Calculations
Creating a Report Generator Report - Page Breaks
Creating a Report Generator Report - Filtering Records (Print If)
Creating a Report Generator Report - Adding Check Boxes to the Specification Window
Creating a Report Generator Report - Adding Radio Buttons to the Specification Window
Creating a Report Generator Report - Searching for Records within a Period
Creating a Report Generator Report - Break Points, Subtotals and Totals
Creating a Report Generator Report - Blocks
Creating a Report Generator Report - Syntax
Creating a Report Generator Report - Useful Functions
Example Reports - Listing Sales Figures
Creating a Report Generator Report - Common Error Messages

Tutorials for Standard Accounts

Creating a Report Generator Report - Bringing Information in from Other Registers

This page describes bringing information in to a Report Generator report from related records in other registers.

---

There will be occasions when the register in a particular section does not contain all the information that you want printed. If so, you can link to another register or setting to bring in the information that you need. For example, each Contact record has a Customer Category Code field, but not a Customer Category Name field. If you want to print a Customer List that includes Category Names, you will have to establish a link to the Customer Categories setting. Similarly, each Invoice Item includes the Unit Price and the Sum charged to the Customer. It would be possible to establish a link to the Item register to bring in the Base Price of each Item, so that the standard sales price of an Item (its Base Price) could be compared with the actual sales price (the Unit Price in an Invoice). Follow these steps:

  1. Return to the Report Definition record and go to the 'Data' card.

  2. Select the register that you are linking from. For example, to print a Customer List that includes Category Names, you will have to establish a link from the Contact register to the Customer Categories setting. So, click on the line marked "Register: Contacts...".

  3. Click the [Look Up] button above the report display area. The 'Lookup Record' dialogue box appears:

    Register
    Paste Special    Registers in Standard ERP
    Specify here the register that you want to link to.

    The register you are linking from and the one you are linking to must have a common field. In the example, the Customer Category Code is common to the Contact register and the Customer Categories setting.

    The link will usually be a "many-to-one" (or "one-to-one") link: there will only be one record at the end of the link. In the example, several Customers can have the same Customer Category Code, but only one Customer Category can have that same Code. So in this case there will only be one Customer Category record at the end of the link.

    Index
    Paste Special    Indexes in the selected register
    Use this field to specify the sort order to be used in the register you are linking to.

    It's best to sort this register by the common field (see above).

    Variable Name
    Enter a name for the variable that will contain the linked record (in the example, the Customer Category record).

    where, is
    Use these fields to construct the search expression that will find the single matching record in the register you are linking to. The Where field should contain the field in the linked register that is to be searched, while the Is field should contain what is being searched for.

    The Where column contains a list of fields in a particular register or setting: in this case, the Customer Categories setting. This list cannot be changed: it depends on the Index you specified in the field above. If you want to search in a field that is not listed, you will need to change the Index first. In this example, you can search in the Code field in the Customer Categories setting.

    Specify what you are searching for in the Is column: in this case, the Customer Category Code of the current Customer. In the top field in the Is column in the illustration below, we have entered the expression that holds this information: "vrContact.CustCat".

    Note that although the Customer Category Code field is the common field, the internal names for this field in the Contact register and in the Customer Categories setting are not the same ("CustCat" in the Contact register and "Code" in the Customer Categories setting).

    Find
    As mentioned above in the description of the Register field, the link will usually be a "many-to-one" (or "one-to-one") link: there will only be one record at the end of the link. However, it may be that the link is a "many-to-many" link, where there are many records at the end of the link. If so, use these options to specify whether the link is to be made with the first of those records or the last.

    When you click [OK], the lookup appears as a "Lookup:" line in the Contact section in the report display area:

    Because the lookup is in the Contact register section, it will be carried out once for each Customer listed in the report.

  4. Now you can specify what information from the linked register is to be printed in the report. You must do this using variables because the linked register will not be given its own sections on the 'Layout' card. The sections that are already in the report cannot accept fields from the register you are linking to. In the example, the Contact Header, Before, After and Footer sections can only accept fields from the Contact register, not from the Customer Category register.

    Change to the 'Layout' card and click on the section in which you want the variable to be printed. Then, click the [Formula] button. When the 'Formula' dialogue box opens, enter the name of the variable and appropriate left and right co-ordinates and choose a justification.

    In this example, the expression "vrCategory.Comment" will print the Customer Category Name. "vrCategory" is the name of the variable containing the current Customer Category (as specified in the 'Lookup Record' dialogue box above), and "Comment" is the internal name for the Customer Category Name field in the Customer Categories setting.

  5. When you click [OK], the formula is placed in the correct position (in our example, in the Contact Before section):

    This is the result:

Please refer here for more details about bringing information in from other registers, and using that information in calculations.

---

Creating a Report Generator Report:

Go back to: