[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Collapse]Scheduler (legacy)
   [Expand]Overview
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Visual Elements
   [Collapse]Examples
    [Expand]Appearance
    [Expand]Data Binding
    [Expand]Data Exchange
    [Expand]Date and Time
    [Expand]Forms
    [Expand]Initial Settings
    [Expand]Menu
    [Collapse]Printing
      How to: Add XtraSchedulerReport to a WPF Application (legacy)
      How to: Create a Report without Visible SchedulerControl (legacy)
      How to: Invoke the Print Preview dialog for a Scheduler (legacy)
    [Expand]Protection
    [Expand]Range Control
    [Expand]Recurrence
    [Expand]Selection
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Create a Report without Visible SchedulerControl (legacy)

Note

You are viewing documentation for the legacy WPF Scheduler control. If you're starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.

If all you need to do is to print a schedule based on the data obtained from a data source, and a visible form containing a SchedulerControl and editing capabilities are unnecessary, follow the steps below.

  1. Drop the DocumentPreview control onto the form from the DX.18.2: Reporting toolbox tab.
  2. Create a stand-alone SchedulerStorage, bind it to appointment data and specify standard mappings for appointment properties. This storage will play the role of the data source for a report's print adapter.
  3. Create a new XtraSchedulerReport object and load the WeeklyStyle template from the gallery of ready-made scheduler report layout templates. To get step-by-step instructions, see the How to: Add XtraSchedulerReport to a WPF Application (legacy) topic.
  4. Drop the DXSchedulerStoragePrintAdapter print adapter onto the form from the DX.18.2: Scheduling toolbox tab. Set its DXSchedulerStoragePrintAdapter.SchedulerStorage property to the previously created SchedulerStorage as the data source for the print adapter.
  5. Use the DXSchedulerPrintAdapter.TimeInterval, DXSchedulerPrintAdapter.FirstDayOfWeek and other options to customize the print adapter.
  6. For advanced customization, a set of Validate* events, such as the DXSchedulerPrintAdapter.ValidateAppointments, DXSchedulerPrintAdapter.ValidateResources, DXSchedulerPrintAdapter.ValidateTimeIntervals, or DXSchedulerPrintAdapter.ValidateWorkTime can be helpful. In this example, handle the ValidateAppointments event to filter appointments and display only recurring ones.
  7. Specify the scheduler print adapter for the report via the XtraSchedulerReport.SchedulerAdapter and DXSchedulerPrintAdapter.SchedulerAdapter properties.
  8. Call the XtraReport.CreateDocument method to create a report document, so it can be displayed or printed.
  9. Finally, create an instance of the XtraReportPreviewModel class with the passed report that has been previously created. Set this preview model to the DocumentPreview.Model property of the DocumentPreview control located on the form.

The following code illustrates the technique described above.

Run the application. The Weekly Style report preview will be displayed.

Is this topic helpful?​​​​​​​