Use Report Parameters
- 3 minutes to read
Report parameters pass data to a report before it is generated in preview.
The Document Viewer displays the Parameters panel that shows editors for the visible report parameters and allows users to specify parameter values. You can also specify parameter values in code.
The Parameters panel displays the specified parameters values. Disable the report’s RequestParameters option to let the Document Viewer create a document with predefined parameter values and avoid the “Waiting for parameter values” message in Preview.
To hide the Parameters panel, disable the Parameter.Visible property for all report parameters.
Tip
Youtube video: DevExpress Reporting Parameters
The topics in this section describe how to create report parameters of different types and specify their values:
- Create a Report Parameter
- Report Parameters with Predefined Static Values
- Report Parameters with Predefined Dynamic Values
- Multi-Value Report Parameters
- Cascading Report Parameters
- Date Range Report Parameters
- Report Parameters of Custom Types
Use report parameters in the following cases:
-
Report parameters can be referenced in a filter string.
Tip
Data can be filtered:
- On the report level. All data is loaded from the data source before a filter is applied.
- On the data source level. Only the filtered data is loaded. See Filter Data for more information.
In Expressions
You can create a report parameter and use it in expressions. For instance, you can do the following:
- Specify a calculated field‘s value.
- Bind a control to data.
- Conditionally change a band’s visibility or a control’s appearance.
In Mail Merge
You can use a report parameter in a control’s text.
As a Value Source for Control Parameters
The following controls have internal collections of parameters. You can bind these internal parameters to report parameters.
-
Use cross-tab parameters to filter data or change control appearance.
-
Filter chart data by parameters.
-
Use the control’s parameters collection to specify parameter values in the report that the XRSubreport control references.
-
As a Value Source for Data Source Parameters
The following data sources have internal collections of parameters. You can bind these internal parameters to report parameters to make them dependent on an external value.
-
Use query parameters to filter data on the database level or pass values to a stored procedure. See Specify Query Parameters.
-
Use path parameters, query parameters, and header parameters to configure HTTP requests to the web service endpoint.
-
Use object data source parameters to pass variables to the method that fetches data.
-
Use EF data source parameters to pass variables to the method that fetches data.
-
Display a Report Parameter Value in a Report Explicitly
Wherever you specify a parameter name, prefix it with the question mark character.