Back to Devexpress

StorageOptions.SavingFormat Property

xtrareports-devexpress-dot-xtrareports-dot-configuration-dot-storageoptions.md

latest4.8 KB
Original Source

StorageOptions.SavingFormat Property

Specifies the format for serializing reports in the End-User Report Designer for WinForms.

Namespace : DevExpress.XtraReports.Configuration

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public SerializationFormat SavingFormat { get; set; }
vb
Public Property SavingFormat As SerializationFormat

Property Value

TypeDescription
SerializationFormat

A SerializationFormat enumeration value.

|

Available values:

NameDescription
Xml

The report is saved in XML format.

| | CodeDom |

The report is saved in CodeDOM format.

| | Soap |

For internal use.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to SavingFormat
Settings

.StorageOptions .SavingFormat

|

Remarks

Once a report class is constructed, it’s possible to store its definition (layout and configuration) either to hard disk or to a database, e.g. for later editing of the report, previewing and printing. Report definitions can be saved to REPX files in XML or CodeDOM format.

Important

Reports and report style sheets created in the Report Designer for WinForms are saved to XML by default.

To prevent injecting arbitrary code into a report definition opened in the End-User Report Designer, we strongly recommend that you use the XML serialization for saving reports.

To learn more, see Data Access Security.

The following code illustrates how to enable your end-user reporting application to save reports in CodeDOM format (both newly created reports, and reports restored from XML definitions). These settings do not affect serialization of report style sheets (they are always saved in XML format).

csharp
using DevExpress.XtraReports.Configuration;
using System.Windows.Forms;
// ...

public partial class Form1 : Form {
    public Form1() {
        InitializeComponent();
        Settings.Default.StorageOptions.SavingFormat = 
            DevExpress.XtraReports.UI.SerializationFormat.CodeDom;
        Settings.Default.StorageOptions.ShouldKeepLoadingFormat = false;
    }
}
vb
Imports DevExpress.XtraReports.Configuration
' ...

Public Class Form1
    Public Sub New()
        InitializeComponent()
        Settings.Default.StorageOptions.SavingFormat = _ 
            DevExpress.XtraReports.UI.SerializationFormat.CodeDom
        Settings.Default.StorageOptions.ShouldKeepLoadingFormat = False
    End Sub
End Class

See Also

Store Report Layouts

Data Access Security in WinForms Applications

StorageOptions Class

StorageOptions Members

DevExpress.XtraReports.Configuration Namespace