Customize the Query

Note

This wizard step appears only if you're creating a new report from scratch. In this instance, familiarity with database connections is required, so we recommend that you contact your application administrator or vendor for assistance. If you're modifying an existing report, this step will not appear and you will start with the Choose Columns to Display in Your Report wizard page.

Expanded Purpose

On this page, you can construct an SQL query to obtain data from the database, or select a stored procedure.

Expanded Query

To construct an SQL query, do the following.

  1. Click the Run Query Designer... button.

  2. In the invoked Query Designer window, select an item from the list of available tables on the left and drop it onto the list of data tables to be used.

    It is only possible to select a single table using the Query Designer. When creating a master-detail report, add the master table first.

  3. Enable the check box near the added table to include all of its fields in the data view.

    To assign a custom name to a data field, specify its Alias in the field list displayed below.

    To manually customize an SQL string, enable the Allow SQL Editing option. Switching to this mode disables the visual features of the Query Designer allowing you to directly edit the text of the SQL query.

    Click OK to exit the Query Designer

    Click Next to proceed to the next wizard page: Choose Columns to Display in Your Report.

Expanded Stored Procedure

To use a stored procedure, do the following.

  1. Select a stored procedure from the list of the available stored procedures and click Next.

  2. Configure the parameters to be passed to the selected stored procedure. Make sure that the value of the passed parameter's Type property corresponds to the actual type the stored procedure parameter.

    Click Next to proceed to the next wizard page: Choose Columns to Display in Your Report.