The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPObjectSource Class

Enables binding reports to XPO persistent class' data.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.1.dll

Declaration

[ToolboxBitmap(typeof(XPObjectSource), "XPObjectSource.bmp")]
[ToolboxSvgImage("DevExpress.DataAccess.Images.XPObjectSource.svg,DevExpress.DataAccess.v19.1, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
[XRDesigner("DevExpress.DataAccess.UI.Design.XRXPObjectSourceDesigner,DevExpress.DataAccess.v19.1.UI, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672", typeof(IDesigner))]
public class XPObjectSource : DataComponentBase, IBindingList, IList, ICollection, IEnumerable, ITypedList, ISupportInitialize, IListAdapter, IXPDictionaryProvider
<ToolboxBitmap(GetType(XPObjectSource), "XPObjectSource.bmp")>
<ToolboxSvgImage("DevExpress.DataAccess.Images.XPObjectSource.svg,DevExpress.DataAccess.v19.1, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
<XRDesigner("DevExpress.DataAccess.UI.Design.XRXPObjectSourceDesigner,DevExpress.DataAccess.v19.1.UI, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672", GetType(IDesigner))>
Public Class XPObjectSource
    Inherits DataComponentBase
    Implements IBindingList, IList, ICollection, IEnumerable, ITypedList, ISupportInitialize, IListAdapter, IXPDictionaryProvider
[ToolboxSvgImage("DevExpress.DataAccess.Images.XPObjectSource.svg,DevExpress.DataAccess.v19.1, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")]
[XRDesigner("DevExpress.DataAccess.UI.Design.XRXPObjectSourceDesigner,DevExpress.DataAccess.v19.1.UI, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672", typeof(IDesigner))]
public class XPObjectSource : DataComponentBase, IBindingList, ICollection, IEnumerable, IList, ITypedList, ISupportInitialize, IListAdapter, IXPDictionaryProvider
<ToolboxSvgImage("DevExpress.DataAccess.Images.XPObjectSource.svg,DevExpress.DataAccess.v19.1, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672")>
<XRDesigner("DevExpress.DataAccess.UI.Design.XRXPObjectSourceDesigner,DevExpress.DataAccess.v19.1.UI, Version=19.1.99.0, Culture=neutral, PublicKeyToken=c38a27d2243c2672", GetType(IDesigner))>
Public Class XPObjectSource
    Inherits DataComponentBase
    Implements IBindingList, ICollection, IEnumerable, IList, ITypedList, ISupportInitialize, IListAdapter, IXPDictionaryProvider

Remarks

XPObjectSource can be used at design time via the Report Wizard:

XPObjectSource

You can also initialize and enable XPObjectSource in code. Create an XPObjectSource instance. Initialize the XPObjectSource.ConnectionStringName property and pass the persistent object type to the XPObjectSource.SetEntityType method. Then, pass the XPObjectSource instance to the XtraReportBase.DataSource property of your XtraReport.


using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
using DevExpress.XtraReports;
// ... 
XPObjectSource dataSource = new XPObjectSource();
dataSource.ConnectionStringName = "ConnectionString";
dataSource.SetEntityType(typeof(Product));
using(XtraReport2 report = new XtraReport2()) {
    report.DataSource = dataSource;
    // ... 
    // Preview the report or do something else. 
    // .. 
}
Tip

The complete step-by-step examples are provided in the Reporting documentation:

Inheritance

Object
MarshalByRefObject
Component
DevExpress.DataAccess.DataComponentBase
XPObjectSource

Implements

DevExpress.XtraPrinting.Native.IObject
DevExpress.Data.IParametersRenamer
DevExpress.DataAccess.Native.ISensitiveInfoContainer
DevExpress.Data.IListAdapter
DevExpress.Xpo.Metadata.Helpers.IXPDictionaryProvider
See Also