XtraReport.SaveLayout(String) Method
Saves the report’s definition (layout and configuration) to a file in the REPX format.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v18.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
fileName | String | A String containing the full path (including the file name) specifying where the report’s definition will be saved. |
Remarks
A report definition contains all report settings, as well as settings of report controls. To load the report’s definition from a REPX file, use the XtraReport.LoadLayout and XtraReport.FromFile methods.
Alternatively, to save a report definition in an XML format, use the XtraReport.SaveLayoutToXml.
To learn more, see Storing Report Layouts.
Example
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();
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the SaveLayout(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.