[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
 [Expand]Product Information
 [Expand]Get Started with DevExpress Reporting
 [Expand]Create Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Provide Data to Reports
  [Expand]Use Report Controls
  [Expand]Shape Report Data
   Arrange Dynamic Report Contents
  [Expand]Customize Appearance
  [Expand]Add Navigation
  [Expand]Provide Interactivity
  [Expand]Add Extra Information
  [Expand]Merge Reports
  [Expand]Use Expressions
  [Collapse]Store and Distribute Reports
    Reporting Security
   [Collapse]Store Report Layouts and Documents
     Store Report Layouts
     XML Serialization
     CodeDOM Serialization
     Custom Report Storage
     Save Report Layouts
     Load Report Layouts
     Store Report Documents
     Save and Open Report Documents
   [Expand]Globalize and Localize Reports
   [Expand]Export Reports
    Print Reports
  [Expand]Reporting API
 [Expand]Visual Studio Report Designer
 [Expand]Create End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Store Report Layouts

You can save report layouts created in Visual Studio or end-user Report Designers to a file, stream, database or cloud. This document describes the the main aspects of report serialization.

Expanded Quick Guide to Report Serialization

A report's definition stores the a report class's type name and complete information about the report layout (settings of the report and all its elements).

Report definition files have the REPX extension by default. This file extension is used to filter data in the Save File and Load File dialogs displayed in the Report Designer.


DevExpress reports are backward compatible and do not need to be updated each time you upgrade your product version.

After saving a report's definition, you can open it in Visual Studio Report Designer or any End-User Report Designer version (for WinForms, WPF, or ASP.NET).


Report definitions do not store any information about events being handled for a report or its elements. You need to utilize report scripts to store custom code in a report's definition and execute it when publishing this report.

DevExpress Reports support the following serialization mechanisms for storing reports and report style sheets:

  • XML Serialization

    The default serialization mechanism. We recommend using it for security reasons.

  • CodeDOM Serialization

    A legacy approach to saving reports. Avoid using it to prevent unauthorized code injections into a report's definition and execution of harmful code on a client machine when opening these reports.


See Reporting Security for more information on security considerations related to storing and distributing DevExpress reports.

See the following documents to learn how to save and load report layouts:


You can use Report Gallery to store reports and their parts for re-use in other projects.

Implementing a Custom Report Storage allows you to store reports in a database or cloud and share them with multiple users.

Expanded Serialization of Subreports

A report's definition does not include the layout and data bindings of any associated subreports. You need to save them separately when using the XRSubreport control.

As a possible work around, consider using detail report bands instead of subreports.

Expanded Serialization of Data Sources

Unlike published report documents, a report definition does not store the actual values from a report's data sources. It can only include general information about a report's data sources and report elements' data bindings.

When using any of the following data sources, a report's definition includes information about them:


A report definition only stores the data connection name by default. It does not include any sensitive information related to data connections (both the user's credentials and connection string is saved to your application's configuration file by default).

A report definition can contain information about the data source schema (as Base64-encoded text), which includes names of selected data source tables, views, and columns.

Information about a data source assigned to a report's XtraReportBase.DataSource property is serialized along with the report's layout. After opening the report, its data source settings are restored.

A data source's information is not saved to a report's definition when it is not assigned to the XtraReportBase.DataSource property.


You can handle the XtraReport.SaveComponents event to access and manage the list of serialized components.

Use any of the following approaches to enable System.Data.DataSet serialization and a custom data adapter implementing the System.Data.IDataAdapter interface:

  • Specify a report's XtraReportBase.DataSource and XtraReportBase.DataAdapter properties.
  • Add these objects to the XtraReport.ComponentStorage collection.
  • Use the ObjectDataSource:

Complete System.Windows.Forms.BindingSource component serialization cannot be guaranteed. You can specify a data source schema for a report when the actual data is not required at design time.

Expanded Serialization of Custom Controls

When a saved report contains custom controls or third-party controls, an application creating the report's definition should be able to create a control of this type. This custom type should be declared either in the current assembly that creates the report or in the assembly the current assembly references.

In some cases, the following unhandled exception can be thrown even if you have referenced the required assembly and deployed it with the main application file: "The type or namespace name 'MyCustomControl' could not be found (are you missing a using directive or an assembly reference?)"

This happens because a referenced assembly is not always automatically loaded into the application's domain, and the corresponding custom class could not be found when loading the report's definition.

Visual Studio does not include a referenced assembly into the resulting assembly by default when your program does not use any types from it, even if you added this assembly to the list of your project's references.

To avoid this issue, you need to manually load this assembly before opening any report definitions that have a reference to this custom type:

Custom controls referenced in a report's definition cannot be loaded in the Visual Studio Report Designer.


See Using Custom and Third-Party Controls to learn more about using custom and third-party controls in DevExpress Reports.

Expanded Serialization of Custom Report Parameters

You can serialize custom parameter types along with report definitions to an XML file by overriding the ReportStorageExtension class and registering a custom ReportDesignExtension, which implements the data source serialization functionality.

To serialize custom objects and properties, specify the XtraSerializeableProperty attribute with the XtraSerializationVisibility.Reference parameter (this parameter defines whether or not an object should be serialized by a reference).

See the following example online for a sample code illustrating how to save a report, along with its parameters of the System.Enum type to an XML file: How to serialize parameters of custom types.

Expanded See Also

Is this topic helpful?​​​​​​​