Skip to main content

DevExpress v25.1 Update — Your Feedback Matters

Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.
report.Parameters.Add(param);

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.