Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Collapse]Reporting
 [Expand]Product Information
 [Expand]Getting Started
 [Expand]Fundamental Concepts
 [Expand]Concepts
 [Expand]Design-Time Features
 [Collapse]Examples
  [Expand]Create a Report in Code
  [Expand]Add a Report to an Application
  [Expand]Design a Report
  [Collapse]Provide Data to a Report
   [Expand]Connect a Report to Data
   [Expand]Connect to Data in ASP.NET
   [Expand]Supply Data to a Report
   [Expand]Use Calculated Fields
   [Collapse]Use Report Parameters
     How to: Create a Report with Parameters
     How to: Create a Report with Parameters (Runtime Sample)
     How to: Create a Report with Multi-Value Parameters (Runtime Sample)
     How to: Provide a Report Parameter with Look-Up Values
     How to: Create a Report with Cascading Parameters
     How to: Silently Pass a Parameter's Value
     How to: Pass Parameters of Custom Types
     How to: Provide Custom Editors for Report Parameters (in a WinForms Application)
     How to: Provide Custom Editors for Report Parameters (in a WPF Application)
  [Expand]Shape Data in a Report
  [Expand]Provide Navigation for Large Reports
  [Expand]Add Interactivity to Documents in Print Preview
  [Expand]Use Charts, Grids and Custom Controls
  [Expand]Use Bar Codes
  [Expand]Add Details about a Report
  [Expand]Customize the Report Appearance
  [Expand]Publish Your Reports
  [Expand]Store Your Reports
  [Expand]Create an End-User Reporting Application
  End-User Capabilities
 [Expand]Localization
 [Expand]Redistribution and Deployment
 [Expand]API Reference
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Pass Parameters of Custom Types

This document explains how you can use report parameters of types other than standard. It demonstrates how to create such parameters at runtime, provide custom editors for submitting their values, as well as extend the set of parameter types available for end-users.

This topic consists of the following sections.

Expanded Create a Parameter of a Custom Type at Runtime

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

When previewing a report with parameters of custom types, the standard editors will be automatically displayed in the Parameters panel to request parameter values. If required, you can implement custom parameter editors as described in the following documents depending on your application's platform.

Expanded Provide Custom Parameter Types for the WinForms End-User Report Designer

You can enable end users to create parameters of custom types in the End-User Report Designer for WinForms.

To accomplish this, do the following.

  1. Create a custom report design extension by inheriting from the ReportDesignExtension class.

  2. In this descendant, override the ReportDesignExtension.AddParameterTypes method in order to register custom parameter types.

  3. Then, register the custom extension using the ReportDesignExtension.RegisterExtension method.

  4. Assign a required report to the created extension by calling the ReportDesignExtension.AssociateReportWithExtension method.

As a result, the created parameter types will be available for the associated report in the Report Designer.

Code examples are available online in the following blog posts.

To learn how to serialize custom parameter types along with a report definition to an XML file, see How to: Serialize Parameters of Custom Types.

Expanded Provide Custom Parameter Types for the WPF End-User Report Designer

To provide custom parameter types for the End-User Report Designer for WPF, use methods of the static ParameterTypeRegistrator class as shown below.

The registered types will be available for all Report Designer instances opened in the application.

Expanded Provide Custom Parameter Types for the Web End-User Report Designer

To register custom parameter types in the End-User Report Designer for ASP.NET, use the client-side ASPxClientReportDesigner.AddParameterType method. This method accepts the following two parameters.

  1. An object that provides information about a parameter type to be added.

  2. An object that provides information about an editor used to specify parameter values in design mode.

If you need to add a new parameter type based on an existing type, call the ASPxClientReportDesigner.GetParameterInfo method with the existing type passed as a parameter, and override required settings of an obtained object. Similarly, you can call the ASPxClientReportDesigner.GetParameterEditor method to get a standard parameter editor for the specified type.

To remove available parameter types from the End-User Report Designer, use the ASPxClientReportDesigner.RemoveParameterType method.

The added parameter types will be available for all reports opened in the Web Report Designer.

Expanded See Also

How would you rate this topic?​​​​​​​