Configuring DBF Tables
<< Click to Display Table of Contents >> Configuring DBF Tables |
![]() ![]() ![]() |
Data source configuration and management is handled via the Section Properties dialog. Here is where you add, delete, configure and specify the relationships between DBF tables.
When DBF tables are used to supply data to a section, the Section Properties dialog will look similar to the figure below. The figure shows two DBF tables related together. In this example, the Invoice table is a child of the Parcel table.
Tables are added, deleted and configured via pop-up menu options that are available when you click the right mouse button over a table object. The options available for DBF tables are:
Adding Child Table/SQL Query
This option allows you to add a DBF table, SQL or Jasmine query as a child of the selected table. If you choose this option, you will be prompted to select a database driver and data source. See Creating a Standard Report for more information on selecting a data source.
When you add a child table or query, ReportPro automatically defines the relationship between the parent and the child. To modify the relationship, select the Relationship option for the child table or query.
Index
The Index option allows you to specify an existing index to use for the sort order. This option is only available for the primary DBF table in the data source. Specifying this option can reduce the time required to generate a report since the sort order doesn't have to be created by ReportPro.
Seek Expression
The Seek expression allows you to specify a starting point for the report. If you specify a Seek expression, ReportPro will evaluate the expression before reporting starts and then seek to that location in the primary table. Reporting will start at the point of the seek.
Seek expressions are only valid if an index for the primary table or a sort order is specified. The seek that is performed is a soft seek; that is, it locates the point where the value returned by the expression would reside in the index even if the value is not present in the index.
If ReportPro creates the sort order, it is important to note that ReportPro converts all field values to character strings. For example, if you create a sort order on a numeric field, ReportPro converts the field to a string value and then builds the index. Generally this has no affect on reporting, but it does affect how you must specify a Seek expression since the Seek expression must also be specified as a character string.
Here's how ReportPro converts fields when creating an index:
Field Type |
Generated Expression |
Sample Seek Expression |
Numeric |
Str(field name, width, decimals) |
'" 100"' |
Character |
Upper(field name) |
'"SMITH"' |
Date |
Dtos(field name) |
'"19961205"' |
Logical |
Iif(field name,"1","2") |
'"1"' |
Memo |
Upper(left(field name,40)) |
'"MEMO SEEK"' |
While Expression
The While expression allows you to specify an expression that can conditionally terminate the report. ReportPro starts at the top of the primary table (or at the position determined by the Seek expression) and prints records that satisfy the filter condition. If you specify a While condition, the report prints until the While expression returns false at which point reporting stops.
Table Relationships
ReportPro allows you to control the relationship between DBF tables. This feature gives you precise control over how your data is retrieved when your report consists of two or more DBF tables. When you select the Relationship option you are presented with the Table Relations dialog where you can specify the desired relationship.
Change RDD
This option allows you to change the database driver you are using for a table. When you select this option you will be presented with a list of available drivers to select from. The driver you choose depends on the type of index and memo files used by the table.
The NTX driver should be used with Clipper indexes and .DBT memo files. The CDX driver should be used with FoxPro 2.5 indexes and .FPT memo files. The MDX driver is used to access dBase 4 indexes and memo files.
Change Table
This option allows you to replace the selected table with another table without loosing the settings for the table. This feature is useful when the table has been moved to a different directory or there are multiple tables with the same structure (say one table for each customer) that you wish to report against. When you select this option you will be presented with the standard Windows File Open dialog where you can specify the new table.
Delete Item
This option deletes the selected table. It is important to note that when you delete a table, you also automatically delete all the children of that table.
Also See: