The requested page is not available for the requested platform. You are viewing the content for Default platform.

Register Custom Report Parameter Types

You can register custom report parameter types in the Web End-User Report Designer using the client-side ASPxClientReportDesigner.AddParameterType method. This method accepts the following 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 an obtained object's required settings. Similarly, you can call the ASPxClientReportDesigner.GetParameterEditor method to get a standard parameter editor for the specified type.

The ASPxClientReportDesigner.RemoveParameterType method allows you to delete the available parameter types from the End-User Report Designer.

<script type="text/javascript" id="script">
    function init(s) {
        // Specify settings of a parameter type to be registered.
        var parameterInfo = {
            value: "System.Custom",
            displayValue: "Custom Integer",
            defaultValue: 0,
            specifics: "integer",
            valueConverter: function (val) {
                return parseInt(val);
            }
        };

        // Obtain a standard parameter editor for the specified type.
        var parameterEditor = s.GetParameterEditor("System.Int64")

        // Register a custom parameter type.
        s.AddParameterType(parameterInfo, parameterEditor);

        // Remove an existing parameter type.
        s.RemoveParameterType("System.DateTime");
    }
</script>

@Html.DevExpress().ReportDesigner(settings => {
    settings.Name = "ReportDesigner";
    settings.ClientSideEvents.Init = "init";
}).Bind(Model).GetHtml()

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

web-report-designer-custom-parameter-type

Tip

When previewing a report with custom type parameters, the standard editors are automatically displayed in the Parameters panel to request parameter values.

See Provide Custom Editors for Report Parameters to learn how to implement custom parameter editors.