.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

DataSourceBase.CreateObjectSpace(Type, IServiceProvider) Method

Creates an Object Space.

Namespace: DevExpress.Persistent.Base.ReportsV2

Assembly: DevExpress.Persistent.Base.v20.1.dll


public static IObjectSpace CreateObjectSpace(
    Type dataType,
    IServiceProvider serviceProvider
Public Shared Function CreateObjectSpace(
    dataType As Type,
    serviceProvider As IServiceProvider
) As IObjectSpace


Name Type Description
dataType Type

A Type object that specifies the business object type for which the Object Space is retrieved.

serviceProvider IServiceProvider

An IServiceProvider object.


Type Description

An IObjectSpace object.


You can use this static method to access an Object Space in report scripts:

private void report_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    DevExpress.ExpressApp.IObjectSpace objectSpace = 
        DevExpress.Persistent.Base.ReportsV2.DataSourceBase.CreateObjectSpace(typeof(MyObject), (DevExpress.XtraReports.UI.XtraReport)sender);
See Also