Parameter.Value Property
Specifies the report parameter‘s value.
Namespace: DevExpress.XtraReports.Parameters
Assembly: DevExpress.Printing.v19.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
Object | The parameter’s value. |
Remarks
Use this property to specify a parameter’s value.
As an alternative, you can add an item to the ExpressionBindings property to set an expression that specifies the parameter’s Value.
Specify the parameter’s Type to define the data type the parameter stores and which editor the parameter uses in Print Preview.
Example
The code sample below illustrates how to create a date parameter and filter report data by this parameter.
using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.Expressions;
// ...
XtraReport1 report = new XtraReport1();
Parameter myDateParameter = new Parameter();
myDateParameter.Name = "myDateParameter";
// Set the Visible property to true to request the parameter value from users.
// Set this property to false to assign the parameter's value in code.
myDateParameter.Visible = false;
myDateParameter.Type = typeof(System.DateTime);
myDateParameter.Value = new DateTime(2019, 1, 1);
report.Parameters.Add(myDateParameter);
// Filter report data by the specified parameter.
report.FilterString = "GetDate([OrderDate]) >= ?myDateParameter";
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Value property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.