Define a Query
You can define a query in the Reporter Document Properties window (see
Set Report Document Properties (see
Set Report Document Properties)). Then, you can specify a query definition for the report and view SQL statements.
To begin defining a query
1. Click Query Definition in the Reporter Document Properties window.
The Query Editor appears. Available tables are shown in the Tables List.
2. Click Edit, View Columns in the Query Editor if you want to view a list of table columns for the highlighted table in the Query Editor's Tables List.
The Table Columns dialog appears, which shows all columns associated with the selected table and lists the total number of columns retrieved for that table.
To specify a query definition for the report
1. Drag and drop the table icons for the tables of your choice to the Query Definition pane.
Alternatively, double-click the items in the Tables List that you want to include in the report query.
The table name is highlighted in the Table List, and an x appears in the toggle field to the right of the table name.
Table names you select appear as icons in the Query Definition pane.
When tables are placed in the Query Definition pane, they are designated as Primary or Secondary <aster (M, m) or Primary or Secondary Detail (D, d), as indicated by the icons—M,m, D,d—located to the right of the Alias field.
With the exception of Primary Master, you can change these designations by clicking the table icon then clicking the desired Secondary Master or Primary or Secondary Detail icon.
You may specify more than one table, but only one table can be a Master table and only one can be a Detail table. For more information, see
Query Editor Fields (see
Query Editor Fields).
2. Click the appropriate join icon in the Query Definition pane to access the Reporter Join Query Editor. For more information, see
Create Table Join Definitions (see
Create Table Join Definitions).
Important! Table names cannot be changed after document creation. Tables may be added or deleted; deleting a table removes associated fields from the report.
To view SQL statements
Select at least one table and then, in the Query Editor, click Edit, View SQL Code.
Note: You can also access the SQL Code Viewer by clicking SQL Code in the Reporter query toolbar.
The SQL Code Viewer appears.
The Query Editor supports correlation names for tables, permitting you to specify auto joins. By default, the correlation name is the table name; you can modify this in the Alias entry field.
After the relations are generated, you can define table joins or generate them automatically by checking the Automatic Joins Research command on the Query Editor Edit menu.