XtraReportBase.XmlDataPath Property
Specifies the path to an XML file that should be used as the report’s data source.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v25.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[DefaultValue("")]
[SRCategory(ReportStringId.CatData)]
public virtual string XmlDataPath { get; set; }
Property Value
| Type | Default | Description |
|---|---|---|
| String | String.Empty | A String value that specifies the full path (including file name and extension) to the XML file. |
Remarks
Note
Use this property only to bind reports to XML documents that do not contain an embedded schema definition in XSD format. In all other cases, bind a report to XML data using the Report Wizard. Refer to the Binding a Report to XML Data help topic for examples.
You can use the XmlDataPath property to bind a report to an XML file. This approach has the following advantages:
- The file may not include a schema.
- The file may contain complex types.
The XmlDataPath property also contains the following limitations:
- Field types may be interpreted incorrectly. For instance, a numeric field may appear as a character string.
- For security reasons, v18.1.6+ builds ignore the XmlDataPath property in web applications.
Tip
To use the XmlDataPath property in web applications, set the SecurityLevel property to Unrestricted on application startup.
The following example binds a report to an XML file with complex type elements:
using DevExpress.XtraReports.UI;
//...
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
XtraReport report = CreateReport();
ReportDesignTool designTool = new ReportDesignTool(report);
designTool.ShowRibbonDesignerDialog();
}
private XtraReport CreateReport()
{
XtraReport report = new XtraReport();
report.XmlDataPath = "ComplexTypes.xml";
return report;
}
}
More Examples
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the XmlDataPath property.
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.