Query Custom Combo Box
The SQL Template Designer offers a feature to design a combo box that is populated with the results of the query. In addition to configuring the Query Custom Combo Box, a relevant report template query must be constructed to enable accurate report filtering using the combo box.
In the Template Designer component, double-click to access the configuration window.
In the Heading field, enter the heading that will appear in the report template's scope selector with the drop-down list.
In the Custom Combo Box query field, supply a query with the following components and then click .
SQL command
SELECT DISTINCT
Key field, Field value
The comma-separated is derived from a published view. For example:
Key: storage_array_id
Value: array_name
The in the key-value pair is what will substitute the ${queryCombon} variable and the is shown in the Combo box.
Use the help for descriptions of the published database views, including the available fields.
Access these views and fields using the SQL Template Designer Query tab.
Published view
End the SELECT statement with FROM and the published view, with optional list criteria. For example:
FROM aps_v_array_group ORDER BY array_name ASC
Sample Query Custom Combo Box Queries
SELECT DISTINCT server_id, server_name FROM apt_v_job SELECT DISTINCT client_id, client_name FROM apt_v_job SELECT DISTINCT product_type, product_type_name FROM apt_v_job SELECT DISTINCT job_type, job_type_name FROM apt_v_job SELECT DISTINCT vendor_status, vendor_status_name FROM apt_v_job SELECT DISTINCT policy_id, policy_name FROM apt_v_nbu_job_detail SELECT DISTINCT policy_type, policy_type_name FROM apt_v_nbu_job_detail SELECT DISTINCT media_server_id, media_host_name FROM apt_v_nbu_job_detail SELECT DISTINCT storage_array_id, array_name FROM aps_v_array_group
In the Query tab, enter a SQL query that will use the value selected in the populated combo box. For example:
select * from aps_v_array_group WHERE storage_array_id='${queryCombo1}'
Note:
Report designer variables are listed at the bottom right of the dialog window. Double-click a queryCombo variable to insert it into the query. If the ${queryCombo1} value is a string, it must be enclosed in single quotes to be evaluated as a text field. To determine if a database view field is a string or numeric use the Database Views Help. For more information,