Query Templates

Query templates allow you to save a great deal of time if you have particular queries that you run repeatedly. Saved query templates are also listed in the Available Reports area of the Custom Reports window for the particular analysis and can be included in generated reports.

If a standard database (*.rsr21) is open when you save a query, it will be stored in the standalone template file (*.xrt21) that is active for your computer. If an enterprise database (SQL Server or Oracle) is open, then the query will be stored within the enterprise database itself.

This topic explains how to manage query templates, including:

Using a Saved Template in the Query Utility

To use a saved template in the Query window, click the Open Saved Query icon.

The Select Existing Query window will display all saved template files for the type of query that was selected in the Query window (items, Functional Failures, etc.). If you want to search for a different record type, use the drop-down list to update the table.

To select a template, double-click the row or select it and click OK.

The settings on the Criteria and Headers Customization tabs of the query utility will change to reflect the settings used in the saved query.

If you change the criteria in the Query utility after applying a template, your changes will not affect the saved template. (If you want to update an existing query, use the Edit command in the Templates Manager, or simply delete the old template and replace it with a new one.)

Saving New Templates from the Query Utility

To create a template from within the Query utility, configure all of the desired options on the Criteria and Headers Customization tabs and then click the Save Query icon.

The saved template includes all of the settings specified on the Criteria and Headers Customization tabs. It can then be applied to any data source.

Adding and Editing Templates via the Query Template Window

You can also create or edit query templates from the Templates Manager. To open the manager, click the Open Saved Query icon, then click Templates Manager.

Click either the Add or the Edit button on the Query Templates tab. The Query Template window works in the same way as the Query utility, with the following exceptions:

  • You cannot specify the data source, as the query template can be used with any data source.
  • On the panel on the left side of the window, you must specify a name and, if desired, a description of the query template.
  • Instead of a Results tab, the Query Template window has a Preview tab that shows the columns you have selected to include in the results.

Related Topics and Links