Back to Devexpress

ReportDesignExtension.RegisterExtension(ReportDesignExtension, String) Method

xtrareports-devexpress-dot-xtrareports-dot-extensions-dot-reportdesignextension-dot-registerextension-x28-devexpress-dot-xtrareports-dot-extensions-dot-reportdesignextension-system-dot-string-x29.md

latest6.2 KB
Original Source

ReportDesignExtension.RegisterExtension(ReportDesignExtension, String) Method

Registers the custom report design extension to serialize custom parameter types.

Namespace : DevExpress.XtraReports.Extensions

Assembly : DevExpress.XtraReports.v25.2.Extensions.dll

NuGet Package : DevExpress.Win.Reporting

Declaration

csharp
public static void RegisterExtension(
    ReportDesignExtension extension,
    string contextName
)
vb
Public Shared Sub RegisterExtension(
    extension As ReportDesignExtension,
    contextName As String
)

Parameters

NameTypeDescription
extensionReportDesignExtension

A ReportDesignExtension object.

| | contextName | String |

A String value, identifying the context.

|

Remarks

You can use the RegisterExtension property to serialize custom report parameters along with a report’s definition.

To provide parameters of custom types to your report, you should create a custom report design extension inherited from the ReportDesignExtension class.

Then, register the extension (using the RegisterExtension method) and associate the report with the custom extension (using the ReportDesignExtension.AssociateReportWithExtension method).

See the following tutorials to learn how to register custom parameter types in reporting applications created for different platforms:

The following code snippets (auto-collected from DevExpress Examples) contain references to the RegisterExtension(ReportDesignExtension, String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-winforms-custom-xml-serialization/CS/WindowsApplication54/Form1.cs#L20

csharp
ReportExtension.RegisterExtensionGlobal(new ReportExtension());
    ReportDesignExtension.RegisterExtension(new DesignExtension(), ExtensionName);
}

reporting-winforms-parameter-custom-type-serialization/CS/Form1.cs#L13

csharp
static Form1() {
    ReportDesignExtension.RegisterExtension(new CustomReportExtension(), TeamParameterName);
    CustomReportStorageExtension.RegisterExtensionGlobal(new CustomReportStorageExtension());

reporting-winforms-custom-xml-serialization/VB/WindowsApplication54/Form1.vb#L21

vb
ReportExtension.RegisterExtensionGlobal(New ReportExtension())
    ReportDesignExtension.RegisterExtension(New DesignExtension(), ExtensionName)
End Sub

reporting-winforms-parameter-custom-type-serialization/VB/Form1.vb#L15

vb
Shared Sub New()
    ReportDesignExtension.RegisterExtension(New CustomReportExtension(), TeamParameterName)
    CustomReportStorageExtension.RegisterExtensionGlobal(New CustomReportStorageExtension())

See Also

Report Parameters of Custom Types

Store Report Layouts

ReportDesignExtension Class

ReportDesignExtension Members

DevExpress.XtraReports.Extensions Namespace