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

XtraReport.LoadLayout(String) Method

Loads the report's definition (layout and configuration) from a file in the REPX format.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

public void LoadLayout(
    string fileName
)
Public Sub LoadLayout(
    fileName As String
)

Parameters

Name Type Description
fileName String

A String value specifying the path to the REPX file to be loaded, containing the report's definition.

Remarks

A report definition contains all report settings, as well as settings of report controls. To save a report definition to a REPX file or a stream, use the XtraReport.SaveLayout method.

Important

Deserialization of reports obtained from untrusted parties can trigger execution of malicious code that can either be directly embedded into the report definition, or contained in an external assembly referenced by the report.

To avoid this, we recommend that you use XML serialization instead of CodeDOM (in this case, reports can be safely deserialized by using the XtraReport.LoadLayoutFromXml method instead of a less secure LoadLayout method) and prevent any untrusted third-party libraries from becoming available on the server.

When a reporting application is deployed under the Medium Trust permission level, XML serialization is the only option to save reports (CodeDOM serialization is not supported in such environment).

To learn more, see Storing Report Layouts.

Examples

This example demonstrates how to save a report definition to a REPX file (by using the XtraReport.SaveLayout method) and how to load this definition (by using the XtraReport.LoadLayout method).

using DevExpress.XtraReports.UI;
using System.Windows.Forms;
// ...

// A temporary path to save a report to.
string filePath = @"C:\Temp\XtraReport1.repx";

private void button1_Click(object sender, System.EventArgs e) {
    // Create a report.
    XtraReport1 report = new XtraReport1();

    // Save a report's layout to the configuration file.
    report.SaveLayout(filePath);
}

private void button2_Click(object sender, System.EventArgs e) {
    // Create a report.
    XtraReport1 report = new XtraReport1();

    // Load a report's layout from the specified file.
    report.LoadLayout(filePath);

    // Display the print preview.
    ReportPrintTool pt = new ReportPrintTool(report);
    pt.ShowPreviewDialog();
}
See Also