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
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 - Joining Strings and Non-Strings

This page describes bringing several pieces of information together into a single variable in a Report Generator report when at least one of those pieces of information is not a string (e.g. it is a number or a date). Please refer here for more basic information about joining pieces of information together in a single variable.

---

When joining several pieces of information together in a single variable, each piece of information must be a string. If one of the pieces of information is not a string (e.g. it is a number or a date), you must convert it to a string. You can do this in the code or formula that joins the pieces of information together.

Decimals and Integers

Use the ValToString function to convert decimals and integers to strings. In this example, a decimal is converted to a string and then added to a standard text:
vsInvText="Total: " & ValToString(vrInvoice.Sum1,2,",",".",0)
As well as decimals, you can convert integers to strings and then add them to standard texts:
vsInvCount="No. of Invoices: "&ValToString(viInvCount,23,",",".",0)
The ValToString function takes five parameters (in the brackets separated by commas) as follows:
  1. the field, variable or number that you want to be converted to a string

  2. a number signifying whether the first parameter is a decimal or an integer. This number should be 2 if the first parameter is a decimal (first example above) and 23 if it is an integer (second example). If you enter the wrong number, the first parameter probably will not be converted to a string. If you leave this parameter empty, you may cause Standard ERP to crash when you print the report.

  3. the thousands separator that you want to be used in the string. In both examples above, the thousands separator is a comma. The thousands separator must be enclosed in quotation marks ("") because it is a string itself.

  4. the decimal point that you want to be used in the string. In both examples, the decimal point is a full stop. The decimal point must be enclosed in quotation marks ("") because it is a string itself.

  5. if the first parameter is a decimal, set the fifth parameter to 0 (zero) if you want the numbers after the decimal point to be included in the string. Set it to 1 if you do not want the numbers after the decimal point to be included in the string.
In the example formula shown below, the text "Total for the Report: " is joined to the vdInvTotal decimal variable described on the Using Variables and Formulae - More Examples page. The vdInvTotal variable contains the Invoice Total for the whole report:

Use the DateToString function to convert dates to strings:
vsDateText="Date: " & DateToString(vdDateVariable, "DD/MM/YYYY")
The DateToString function takes two parameters (in the brackets separated by a comma) as follows:
  1. the date field or variable that you want to be converted to a string

  2. a string specifying the date format that you to be used in the final string. In the example, we have specified that we want the date that is included in the vsDateText variable to use the Day, Month, Year format, and that two digits are to be used for the Day and Month (i.e. leading zeros are to be used) and four digits are to be used for the Year. This parameter must be enclosed in quotation marks ("") because it is a string itself.
Use the TimeToString function to convert times to strings:
vsTimeText="Time: " & TimeToString(vtTimeVariable)
This function takes one parameter: specify in the brackets after the name of the function the time field or variable that you want to be converted to a string.

Longs

You can add long variables to strings without conversion:
vsLongText=" Text: " & vlLongVariable
Please follow the links below for more details about:
---

Go back to: