Skip to main content
A newer version of this page is available. .

Custom Report Parameters

This document describes how to use custom type parameters in your report.

When creating a report parameter at runtime, you can set its Parameter.Type property to a custom type (such as Enum, or XPCollection):

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 required properties.
param.Name = "GenderParameter";
param.Type = typeof(Gender);
param.Visible = true;

//Add the parameter to the report.
report.Parameters.Add(param);

When previewing a report with parameters of custom types, a Print Preview automatically displays standard editors for requesting these parameters’ values. See Request and Pass Report Parameter Values to learn how to implement custom parameter editors in your application’s platform.

Tip

See Store Report Layouts to learn how to serialize your custom parameters along with a report’s definition.