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
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
   - Searches Controlled by Radio Buttons
   - Sorts Controlled by Radio Buttons
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 - An Alternative Way to Count Records

This page suggests how to count the number of records in a Report Generator report without using a variable.

---

In the previous examples, we described using variables to count the number of records (e.g. the number of Customers and the number of Invoices) in a Report Generator report. You can also use the [Total] button on the 'Layout' card of the Report Definition window to count the number of records. The advantage of using Totals is that it is easier to implement: you don't need to use the [Code] button to increment the variable. In fact, you don't need to use the 'Data' card at all. The disadvantage is that there are restrictions on where you can place the figure in the report (you can only place it in a section related to the register whose records are being counted).

To use Totals to count the number of records, follow these steps:

  1. Return to the Report Definition window and change to the 'Layout' card.

  2. Click on the section where the Total is to appear. Usually this will be the Footer section for the register whose records you need to count. In the example Customer List report that we are using in this documentation, the most appropriate places will be the Contact Footer section (if we need to count the number of Customers) or the Invoice Footer section (if we need to count the number of Invoices). You cannot place a Total in the Report Footer because the Report Footer is not related to a register, so it cannot contain totals calculated using this method. If you need to place a total in the Report Footer, you would need use variables as previously described.

  3. Click the [Total] button. When the 'Total' dialogue box opens, do not specify a Field. Instead, enter "1" as the Field:

    By specifying "1" as the Field, you are instructing the Total to count the printed records in the relevant register. For example, the Contact Footer section is connected to the Contact register so, if you place the Total in this section, it will count the number of printed Contacts (i.e., in the example report, the number of Customers). If you place the Total in the Invoice Footer, it will count the number of printed Invoices.

    Remember that the Invoice Footer section is printed once for each Customer. So, you can use the Clear On Print option as previously described: select this option if you do not want the total to be cumulative (i.e. if you want to print a total number of Invoices for each Customer). If you do not select this option, the count will accumulate so that when the Invoice Footer is printed for the last time it will contain the total number of Invoices in the report (i.e. for all Customers).

  4. As mentioned at the beginning of this page, there are restrictions on where you can place the figure in the report (you can only place it in a section related to the register whose records are being counted). If you want to use the figure elsewhere (e.g. in the Report Footer), specify an integer variable in the Variable Name field in the 'Total' dialogue box. You must have declared the integer variable on the 'Data' card. Then, place the variable in the section that you need as usual using the [Formula] button.
Please follow the links below for more details about:
---

Creating a Report Generator Report:

Go back to: