Define a Table Query
When building components in the Grid Builder it is often necessary to pull specific data and records from a given table, be it .dbf or SQL. To do this it is necessary to create a Table Query.
Select Grid > Query (DBF).
Select the data source table from the Table Name list.
A table alias can make your grid portable, by separating it from direct reference to a table name. as long as a table has the same structure and the same alias, it can use a grid originally built for another table.
Optionally, enter an alias for the table. If you do not enter an alias, it will default to the name of the table.
A calculated value may be displayed, but not edited. Typically, you compute a calculated value based on the values of several other fields in each record. To create a calculated value to place on the grid:
Optionally, click Calculated fieldsto display the Define Calculated Fields dialog box.
a. Enter calculated value expressions, one per line, in the format = . For example:
<fullname> = <alltrim(lastname) + ", " + alltrim(firstname)>
b. Optionally, click Expression Builder to use the Expression Builder to help you define the calculated value.
c. Optionally, click F2 - Fieldsto display a list of table fields to insert into the expression.
d. Optionally, click F4 - Functionsto display a list of functions to insert into the expression.
g. Click OKto continue or Cancelto discard your inputs.
Optionally, if you want to provide a value for use in the grid's filter expression, click Define Argumentsto display the Define Arguments dialog box.
Optionally, enter a logical expression that selects records from the table into the Filter field. You may click to use the Expression Builder to help you define the expression. A blank filter expression retrieves all records in the table.
Optionally, check Unique records onlyto eliminate records with duplicate values.
Optionally, enter a character expression that orders selected records into the Order field. You may click to use the Order Builder to help you define the expression. A blank order expression retrieves records in record number order.
Optionally, click Ascendingor Descendingto change the sequence of records.
Optionally, check Read onlyto indicate that you do not need to define a primary key.
Click Define Primary Key(s)to define the field or character expression that will uniquely identify records.