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 - Syntax

This page describes the syntax you should use when composing "Print If" conditions, formulae and code in Report Generator reports.

---

You should use the following syntax in your "Print If" conditions, in the Formula field in the 'Selection' dialogue box and in the 'Code' dialogue box (all on the 'Data' card), and in the 'Formula' dialogue box ('Layout' card).

Relational Operators

==    is equal to
<>    is not equal to
!=    is not equal to
>    is greater than
>=    is greater than or equal to
<    is less than
<=    is less than or equal to

Do not confuse == with =. Use == when you need to compare two values, to ask if one value is equal to another. "Print If" and Overstrike conditions are appropriate places to use ==. Use = when you need to assign a value to a variable, typically after clicking the [Code] button. For example:

testvar == 1
when this appears in a "Print If" or Overstrike condition, it is asking if testvar is equal to 1.

testvar = 1
when this appears in a line of code, it is stating that testvar is now equal to 1. Any value that testvar had before this statement will be forgotten.
After clicking the [Code] button on the 'Data' card, you can enter an if statement in which both == and = are used:
if (var1 == 1) then begin var2 = 1; end;
In this example, there is first a test to see if var1 is equal to 1. If it is, then var2 is set to 1 as well. If it is not, then var2 retains the value it had previously.

Multiple Conditions

You can use multiple conditions with [Print If]. Join multiple conditions using the following logical operators:

and    both (or all) conditions must be met
or    at least one condition must be met
and !    the first condition must be met and the second must not be met.
or !    either the first condition must be met or the second condition must not be met.

Multiple Code Lines

If you need to add several lines of code to the 'Data' card of a Report Definition, the order in which those lines are listed will often be important. If you click on an existing line of code and then click the [Code] button, the new line will be added below the highlighted line. If you click on a register line and then click the [Code] button, the new line will be added above all the exiting code lines.

---

Creating a Report Generator Report:

Go back to: