Skip to main content
A newer version of this page is available. .

SchedulerPrintAdapter.SetSourceObject(Object) Method

Specifies the object used to get the scheduling data - the SchedulerStorage or the SchedulerControl object.

Namespace: DevExpress.XtraScheduler.Reporting

Assembly: DevExpress.XtraScheduler.v19.1.Core.dll

Declaration

public abstract void SetSourceObject(
    object sourceObject
)

Parameters

Name Type Description
sourceObject Object

A SchedulerStorage or the SchedulerControl object.

Remarks

This method is used to specify the correct scheduling source for the SchedulerPrintAdapter, despite the likely ambiguity caused by the fact that both the SchedulerStorage and the SchedulerControl can play the role of scheduling source.

The SetSourceObject method is abstract, and is overridden in the SchedulerPrintAdapter descendants.

It is intended for use when the report layout is loaded from the .repx file or a stream, and the type of the print adapter contained in the loaded layout is unknown. The following code snippet illustrates this situation.

using DevExpress.XtraScheduler.Reporting;
using DevExpress.XtraScheduler;
// ...
string reportFileName = "DailyStyle.repx";
// Creates a scheduler adapter for the Scheduler Control on the form
SchedulerControlPrintAdapter PrintAdapter = 
    new SchedulerControlPrintAdapter(this.schedulerControl1);
// Customize the print adapter...
// ...
// Create a new report 
XtraSchedulerReport report = new XtraSchedulerReport();
// Loads the .repx file (only layout, no data)
report.LoadLayout(reportFileName);
// Specifies the correct scheduling source even if the type of the scheduler adapter
// in the loaded report is unknown
if(report.SchedulerAdapter != null)
    report.SchedulerAdapter.SetSourceObject(PrintAdapter.SchedulerControl);
else
    report.SchedulerAdapter = PrintAdapter;
// Invokes the Report Designer
report.ShowDesigner();

The following code snippets (auto-collected from DevExpress Examples) contain references to the SetSourceObject(Object) method.

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.

See Also