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.v24.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
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;
using System;
using System.IO;
// ...
// Create a simple report.
XtraReport report = new XtraReport()
{
Name = "SimpleReport",
Bands = {
new DetailBand() {
Controls = {
new XRLabel() {
Text = "Simple Report"
}
}
}
}
};
// Create the report document file in the user's Downloads folder.
report.SaveDocument(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + report.Name + ".prnx");
See Also