Skip to main content

Report Parameters of Custom Types

You can set a report parameter’s type to a custom type (for instance, Enum or XPCollection).

The code sample below sets a parameter’s type to a Gender custom type.

Custom parameter type

using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.UI;
// ...

public enum Gender { Male, Female }

// Create a report instance.
XtraReport report = new XtraReport();

// Create a new parameter.
Parameter param = new Parameter();

// Specify the parameter's properties.
param.Name = "GenderParameter";
param.Type = typeof(Gender);
param.Visible = true;

// Add the parameter to the report's Parameters collection.

Refer to the following topic for information on how to create a custom parameter editor in your application: Implement a Custom Parameter Editor in the Parameters Panel. See this topic for details on how to serialize custom parameters in the report definition: Store Report Layouts.