View on GitHub

dotnet-eud

.NET Controls End-User Documentation

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

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

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.

    EUD_WpfReportDesigner_Parametrized_1

  3. In the invoked Add New Parameter dialog, set the created parameter’s Name and Description properties and make sure to set its Type to an appropriate value. To display this parameter in the Print Preview, enable the Show in the parameters panel option.

    EUD_WpfReportDesigner_Parametrized_2

  4. To assign a list of values to this report parameter, enable the Supports the collection of standard values option.

    In the Dynamic values tab, you can 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.

    In the Static values tab, you can manually fill the list of parameter values. Each parameter value has an individual description specifying how this value appears in the Parameters Panel.

    EUD_WpfReportDesigner_Parametrized_3

  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.

    EUD_WpfReportDesigner_Parametrized_4

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.

EUD_WpfReportDesigner_Parametrized_Result