1 out of 5 rated this helpful - Rate this topic

Running a Parameterized Report

SQL Server 2000

A parameterized report is a report that uses input values to complete report processing. Familiar examples of parameterized reports include those that filter by a regional value, a product category, or an identifier. Parameters are typically used to complete a query that selects data for the report. If you manage or run a parameterized report, you need to understand how parameter selections affect the report you are working with.

Note  A report author defines the parameters used in a report. After the report is published, you can modify some parameter properties to change which values are used and how the values are obtained.

Storing and Prompting for Parameter Values

To get a parameter value at run time, you can store a value with the report or prompt the user to type or select a value. Storing a parameter value with a report is useful if you want the report to always process with a specific value. For example, if a regional office has a dedicated Web site, you can host a regional sales report on the Web site that always uses a specific region code.

You can also prompt users to type or select the value to use when they open the report. When you configure a report to prompt for parameter values, input fields are provided so that the user can type specific values. After typing the values, a user clicks View Report to run the report. If the values are valid, the report appears. If the values are not valid, you will either get an error message or an empty report. If you use stored parameter values, the report opens without displaying input fields or the View Report button. All users who run the report use the same parameter value.

If the report includes query-based parameters, and the data source requires each user to login, the user will be prompted for credentials before the parameter input fields are displayed on the page. In this case, the credentials must be provided in order to retrieve parameter values.

To run a report that requires parameters, you typically must know which values to type. In some cases, a report can include drop-down lists of values from which to choose. If the fields are empty, ask the report author which values to use.

To set parameter properties (including default values) on a report, use Report Manager. For more information, see Setting Parameter Properties for a Published Report and Setting Parameters in a Subscription.

Setting Parameters on a Report URL

Another way to run a parameterized report is through a URL. You can specify one or more parameters in encoded name-value pairs, using the ampersand character (&) to separate them.

Null parameters use special syntax; you must specify isnull for a null value. The following example illustrates multiple parameters for null and constant values:

http://exampleWebServerName/reportserver?/foldercontainingreports/orders&division=mailorder&region=west&sales:isnull

Parameters with multiple values are specified by repeating the parameter name; for example,

http://exampleWebServerName/reportserver?/foldercontainingreports/orders&region=east&region=west

If one of the values is null (that is, isnull), all other values specified for that same parameter are ignored.

Boolean parameters are specified with a value of 0 or 1.

Float parameters must include the decimal separator of the server locale.

DateTime parameters must be specified with the format YYYY-MM-DDTHH:MM:SS, which is based on the International Organization for Standardization (ISO) 8601 standard.

See Also

Parameterized Reports

Running Reports

Viewing and Running Reports

Managing and Working with Published Reports

Did you find this helpful?
(1500 characters remaining)