Parametrized Report

<< Click to Display Table of Contents >>

Navigation:  User Interface Reference > Report Designer > Report Designer for WPF > Report Types >

Parametrized Report

Interface Elements for Desktop > Report Designer > Report Designer for WPF > Report Types > Parametrized Report

This tutorial describes the steps needed to create a report with parameters. In this example, two date-time parameters are created to filter out orders that don't fall in the specified range from the report.

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

The Parametrized report is now ready. Switch to the Print Preview tab, define the required values in the Parameters panel and click Submit.

img123802

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

Send Feedback on this topic to DevExpress.