Skip to main content
A newer version of this page is available. .

XtraReport.SaveDocument(String, NativeFormatOptions) Method

Saves the report document to the specified file in the XML-based PRNX format.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.1.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

public void SaveDocument(
    string path,
    NativeFormatOptions options = null
)

Parameters

Name Type Description
path String

The path to the file to save the report document to.

Optional Parameters

Name Type Default Description
options NativeFormatOptions null

PRNX options to apply to the saved document. You can omit this parameter or set it to null (Nothing in Visual Basic) to use the ExportOptions.NativeFormat settings.

Remarks

If a document has not been generated for the report, the report’s CreateDocument() method is called before the document is saved.

The code sample below shows how to save a report to a file.

using DevExpress.XtraReports.UI;
// ...
// Create a simple report.
XtraReport report = new XtraReport() {
    Name = "SimpleReport",
    Bands = {
        new DetailBand() {
            Controls = {
                new XRLabel() {
                    Text = "Simple Report"
                }
            }
        }
    }
};
// Save the report document to the user's Downloads folder.
report.SaveDocument(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + report.Name + ".prnx");
See Also