The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.v19.1.dll

Declaration

[SRCategory(ReportStringId.CatData)]
public virtual string XmlDataPath { get; set; }
<SRCategory(ReportStringId.CatData)>
Public Overridable Property XmlDataPath As String

Property Value

Type Default Description
String

String.Empty

A String value, specifying the full path (including the file name and extension) to the XML file.

Remarks

This property is retained for backward compatibility and should no longer be used. To learn how to bind a report to XML data, see Binding a Report to XML Data.

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.

Consider the following limitations when using this method:

  • field types may be interpreted incorrectly; for instance, a numeric field may appear as a character string;
  • for security reasons, the v18.1.6+ builds ignore the XmlDataPath property in web applications.
Tip

To use this approach in web applications, set the SecurityLevel property to Unrestricted on application startup.

The following example shows how to bind 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;
    }
}
See Also