Report Parameters

<< Click to Display Table of Contents >>

Navigation:  User Interface Reference > Report Designer > Report Designer for WPF > Creating Reports > Providing Data >

Report Parameters

Interface Elements for Desktop > Report Designer > Report Designer for WPF > Creating Reports > Providing Data > Report Parameters

This document describes the main concepts of using parameters in the Report Designer and provides information on how to create parameters and pass their values.

The document consists of the following sections.

Using Parameters

Creating Parameters

Passing Parameter Values

ExpandedCollapsed Using Parameters

Report parameters provide the capability to pass data of a certain type to a report and can be used in different ways listed below.

Filtering

You can use a report parameter to filter report data according to the current parameter value by specifying the report's Filter String. For more information, see the Filtering Data topic.

img123693

Data Binding

To show a parameter's value in a report, drag the parameter from the Field List panel and drop it onto the required band. This creates a Label bound to the parameter, as with an ordinary data field.

img123830

For more information, see the Binding Report Controls to Data topic.

Calculated Fields and Conditional Formatting

Parameters can participate in constructing expressions for calculated fields and formatting rules, as well as standard data fields. The only difference is that a parameter is inserted into the expression's text using the "Parameters." prefix before its name.

img123831

Cascading Parameters

You can filter parameter values by specifying the filtering expression that can also include other parameter values. To construct this filtering expression, set the parameter's Look-Up Settings Type property to StaticList or DynamicList and then specify its Filter String property.

img123832

Multi-Value Parameters

If a parameter is bound to a collection of standard values, it is possible to store more than one value in it. To do this, enable the parameter's MultiValue property.

img123833

Multi-value parameters are useful when you need to filter report data against a list of values. The image below demonstrates a correct filtering expression that incorporates a multi-value parameter.

img123834

The following image demonstrates an editor for a multi-value parameter in a Print Preview.

img123835

ExpandedCollapsed Creating Parameters

To create report parameters, follow the steps below.

1.Create a new report and bind it to a data source.

2.In the Field List panel, right-click the Parameters section and in the invoked menu, click Add Parameter.

img123797

3.Select the created parameter in the Field List and switch to the Properties Panel to access its settings. Set its Name and Description properties and make sure to set its Type to an appropriate value. To display this parameter in the Print Preview, enable its Visible property.

img123798

4.To assign a list of values to this report parameter, specify the Look-Up Settings property.

Set this property to the DynamicList to obtain parameter values from a data source. In this case, you should specify a parameter's data source, data member, value member and display member. The value member defines a data field that provides values to the parameter. The display member defines a data field that provides display names for parameter values, i.e., how these values appear in the user interface available in a Print Preview.

Set this property to StaticList to manually fill the list of parameter values. Each parameter value has an individual description specifying how this value appears in the Parameters Panel.

img123800

5.Then, repeat the previous steps to create the second parameter, so that every time your report is previewed, you will be asked to specify two dates.

6.Next, use parameters to filter your report's data. Select report, and in the Properties Panel, click the ellipsis button for the Filter String property. Then, in the invoked Filter String Editor, construct an expression where a data field is compared with the created parameters. To access parameters, click the icon on the right until it turns into a question mark.

img123801

ExpandedCollapsed Passing Parameter Values

To view the resulting report in the Report Designer, switch to the Print Preview tab. For a report containing at least one visible parameter, the dedicated Parameters Panel is automatically created in the Preview. This panel provides appropriate editors based on parameter types. To pass parameter values to the report, specify the required values and click Submit.

img123802

ExpandedCollapsed See Also

Parametrized Report

Calculated Fields

Query Parameters

Filtering Data

Binding Report Controls to Data

Copyright (c) 1998-2016 Developer Express Inc. All rights reserved.

Send Feedback on this topic to DevExpress.