Example data source and query

Diagrams #1 and #2 below show how a data source is used with a query to retrieve data in a two-page report. The SQL statement (query) tells the system which data to retrieve from the database and display in the report, based on parameters or criteria. In our example, the data source retrieves records from the EMPLOYEE table based on the parameters specified in the query and the pay group(s) that the user selects from the Pay Groups field.

Diagram #1 shows the Form Builder view of the report, and displays how the dsEmployees data source points to the EMPLOYEES table and contains a query. Using this query, the system retrieves the records of employees that match the criteria the user selects in page 1 of the report (for example, the pay groups that the user selects from the DBLookup control), based on the query parameters.

Diagram #1



Diagram #2 shows the end-user view of the report. When the user selects pay group(s) from the Pay Groups field of the criteria page and runs the report, the system, using the query shown in diagram #1, matches employee records from the EMPLOYEE table with the parameters set in the query, and then displays the results in the rendered report.

Diagram #2