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
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
   - Declaring a Variable
   - Assigning a Value to a Variable
   - Printing a Variable
   - More Examples
   - An Alternative Way to Count Records
   - Joining Two or More Pieces of Information Together
   - Joining Strings and Non-Strings
   - Testing
Creating a Report Generator Report - Printing Information from Matrices
Creating a Report Generator Report - Bringing Information in from Other Registers
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 - Using Variables and Formulae - Assigning a Value to a Variable

This page describes using the [Code] button to assign a value to a variable. Before doing so, you must have "declared" the variable as described here.

---

After declaring a variable, you can assign a value to the variable. In the case of variables that count the number of records in a report or calculate totals, the value of the variable will accumulate as the report is printed. You should therefore take care to increment these variables at the correct time to ensure that they remain accurate. In the example Customer List that we are using in this documentation, we will use a variable to count the number of Customers in the report. Therefore we will link the incrementing to the Contact register, so that the value of the variable will increase by one each time a Customer is printed in the report. Follow these steps:

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

  2. Click on the register line in the report display area (marked "Register: Contacts..." in the example) to select that register. Code that is placed in this section will be used once for each record that is printed. Make sure you do select the correct register as otherwise the code will be placed in the wrong section and therefore the variable will not contain the correct value.

  3. Click the [Code] button. The 'Code' dialogue box opens:

  4. Enter the code that will increase the value of the variable by one each time a record is printed in the report. To do this, specify that the new value of the variable is to be its previous value plus one. The = sign assigns the new value to the variable.

  5. Click the [OK] button to add the code to the Contact register section in the report display area:

    For more details about the syntax that you should use in the 'Code' dialogue box, please refer to the Syntax page.
Having assigned a value to the variable, please follow the links below for more details about:
---

Creating a Report Generator Report:

Go back to: