Create Single Fields
You can use Single Field Creation to create fields that are associated with data in the following ways:
Column of a Selected Table
A Column of a Selected Table type of field is one whose value is determined by the main query when the report is run. It references one of the columns selected from one of the tables specified in the FROM clause of the query.
Single Query
A field associated with a single query gets its value from a query that is not the main query. The query associated with such a field should be a singleton select.
A singleton select query is one for which only one row may be returned. If the query returns more than one row, a runtime error will result. By default, the singleton query is run before the main query; however, by checking the Generate in Main Select toggle when creating the field, the query will be issued in the detail section once for each row returned by the main query.
Calculated Expression
A calculated expression field uses functions and arithmetic operators to compute a value. You define a computed field by combining values in other report fields or by using functions.
To create a single field
1. Click Insert, Data Fields, Create Single Field.
2. Click in the work area and drag the cursor to draw a field (rectangular area).
The Reporter DataField List dialog appears.
Note: The Reporter DataField List dialog lists all data fields currently defined in the document. If no data fields are listed, the Reporter DataField Properties dialog appears automatically, allowing you to create a new data field.
3. Select an existing item in the Columns/Expressions list and click Create Field.
Alternatively, to create a new single field using single field creation:
a. Click the N (New) button.
The Reporter DataField Properties dialog appears.
b. In the Reporter DataField Properties dialog, from the Attach To list, select the desired option (Single Query, Column of a Selected Table, or Calculated Expression).
The Reporter DataField Properties dialog changes to reflect the option you select in the Attach To list field.
To attach a single field to a “Single Query”
1. Enter an alias name.
The alias name is used to create a variable in the generated report code.
Note: The alias name must be used in the select statement. The select statement must retrieve only one row and column.
The Attached Query multiline entry field displays the query associated with the Single Query field. This query is specified when the field is created. The Generate Query in Main Select toggle determines when the attached query is issued. It is independent of the main report query generated automatically by Reporter.
2. Click Check to validate your SQL request.
3. Click in the Generate Query in Main Select toggle field if you want the query to be issued in the detail section once for each row returned by the main query.
4. Click OK.
The Reporter DataField List dialog appears with the selected column added to the list.
5. Click Create Field.
The field you created appears in the work area.
6. Click File, Save to save your work.
To attach a single field to a “Column of a Selected Table”
1. Select the desired table (or accept the default) and column.
The Selected Column field displays your choice.
2. Select the Is a Break Column check box if you want to insert a page break.
3. Click OK.
The Reporter DataField List dialog appears with the selected column added.
4. Click Create Field.
The field is created and added to the Detail page of the report document.
5. Click File, Save to save your work.
To attach a single field to a “Calculated Expression”
Note: When you select Calculated Expression from the Attach To list, the lower half of the Reporter DataFields Properties dialog changes to display four tables—Tables, Columns, Functions, Operators—from which you can select the desired values.
1. Double-click the function you want to use in the Functions list field.
2. Double-click the arithmetic operator you want to use in the Operators list.
3. Double-click the appropriate column name in the Columns list.
The result of your selections appears in the Expression Text entry field. You can edit this text if you want.
4. Click Check to validate the syntax of your user‑defined expression.
5. In the Alias Name field, enter the name of the calculated field you are creating.
6. Click OK.
The Reporter DataField List dialog appears with the new calculated field.
7. Click Create Field.
The new data field is created and added to the report document.
8. Click File, Save to save your work.