<< Click to Display Table of Contents >> Navigation: User Interface Reference > Report Designer > Report Designer for WinForms > Create Reports > Report Types > Parameterized Report |
Interface Elements for Desktop > Report Designer > Report Designer for WinForms > Create Reports > Report Types > Parameterized Report
This tutorial describes the steps needed to create a report with parameters. In this example, we will create two date-time parameters, to filter out orders which don't fall in the specified range from the report.
First, create a report and bind it to a data source.
To add parameters and filter your report based on their values, follow the steps below.
1.In the Field List window, right-click the Parameters section and in the invoked menu, click Add Parameter.
2.In the invoked window for the created parameter, set its Name and Description. And, make sure to set its Type to an appropriate value.
Note
In Print Preview, the report's document is not generated until you have submitted values of all the parameters that have the Show in the parameters panel option switched on via the Parameters UI.
3.Enabling the Supports the collection of standard values option of the parameter allows end-users to modify its value and also activates the Dynamic values and the Static values tabs of the window:
- On the Dynamic values tab, you can specify a parameter's data source, data adapter and data 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 (how these values appear in the user interface available in a Print Preview).
- On the Static values tab, you can manually fill the list of parameter values, with each value having an individual description (specifying how this value appears in the Parameters panel).
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.
The following instructions explain how to use parameters to filter your report's data.
4.Click your report's Smart Tag, and in the invoked actions list, click the ellipsis button for the Filter String property. Then, in the invoked FilterString 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.
The complete filtering expression will then look like this.
The Parametrized report is now ready. Switch to the Preview Tab, and in the Parameters section, define the required values and click Submit.
Copyright (c) 1998-2016 Developer Express Inc. All rights reserved.
Send Feedback on this topic to DevExpress.