XtraReport.SaveDocument(String, NativeFormatOptions) Method
SECURITY-RELATED CONSIDERATIONS
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Saves the report document to the specified file in the XML-based PRNX format.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v25.2.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");