Custom Report Edit Page: Data Source Tab: Query Parameters Tab
Data Source
Tab: Query Parameters
TabWhen you define a query for a new custom report or filter, or modify a query for an existing custom report or filter, you can use query parameters. The
Query Parameters
tab lets you specify the parameters that you want to use in the report query or filter query. A parameter is a variable that is included in the query. Filter and report query parameter values may be system-defined or extracted from another report. For report queries only, a user may set the appropriate parameter values in the Report page. When the query runs, the specified parameter values are used in the SQL code.Using parameters in queries lets you create a flexible query. You can use such a query to extract different results by inserting the appropriate parameter values. For example, you can create a query that includes parameters for computer system type and OS name. You can run this query on any valid system type/OS name combination to extract the results that you want. As an alternative to using parameters in the query, you can hard code the parameter values in the query. You would then modify the query each time you wanted to use a different system type/OS name combination. You can also create multiple queries with a different system type/OS name combination defined in each query.
When you create a parameter in the
Query Parameters
tab, the appropriate parameter declaration is added automatically to a resource query. However, if you write an SQL query, you need to add the appropriate parameter declaration to the query code manually.When you include a parameter in a report query, you can set up the value provider for the parameter. You can specify the value provider type and the valid values for the parameter. The value provider typically lets the user set the appropriate parameter value when they run the report. You set the value provider for a parameter on the
Report Parameters
tab.