Defining the SQL Scripts

The data records for the report are loaded through a SQL Script that is included in each Report Object, being attached as the Text property to a label control lblSQLSource.  This SQL Script must load all records that are required for the respective Report Object - for Sub Reports this includes all Child Records for all Parent Records included in the scope of the entire report.

The SQL Script should include an ORDER BY Clause to sequence the returned records - this defines the record sequence within each Report Object.  The SQL Script may include the following parameter keywords:

If a report is defined to list just one Object Record, but the HighStone call passes in a selection list of several records, then the report will be produced with only the first Object Record from the list.

As an alternative to putting SQL Scripts in to the report format definition the SQL Script may be included in the HighStone SQL Statements Data Table (tbsSQLStatements).  This entry is then referenced by setting the Text property on the Control lblSQLSource to:

#<SQLIdentifier>

#<SQLIdentifier>-<SQLCount>

These reference the target SQL Script, and optionally the Count value. For example:

#36785

#36785-4

All other comments apply to SQL Scripts referenced in this manner.

The DataSource property of each Report Object should be left as blank or (none) as this is not used by HighStone; HighStone uses it's own functions to load the relevant data tables and submit these to the report.  If it is desired to test a report design directly against a target database (not using HighStone), then the DataSource property can be used to achieve this.  However the control setting should be cleared before attempting to use the Report Design within HighStone.