[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]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]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Invoke the Print Preview dialog for a Scheduler (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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3964.

This example demonstrates how to invoke the Print Preview dialog for SchedulerControl via the PrintHelper.ShowPrintPreviewDialog method.

  1. Drop the SchedulerControl item onto the form from the DX.18.1.WPF: Scheduling toolbox tab. Bind the scheduler to data.
  2. Drop the DXSchedulerControlPrintAdapter print adapter onto the form from the DX.18.1.WPF: Scheduling toolbox tab. Set its DXSchedulerControlPrintAdapter.SchedulerControl property to the previously created SchedulerControl instance as the data source for the print adapter.
  3. Set the DXSchedulerPrintAdapter.TimeInterval and DXSchedulerPrintAdapter.FirstDayOfWeek properties of the created print adapter.
  4. Create an instance of the SchedulerPrintingSettings class. Specify its BaseSchedulerPrintingSettings.ReportInstance, BaseSchedulerPrintingSettings.SchedulerPrintAdapter and SchedulerPrintingSettings.ReportTemplatePath properties.
  5. Add the System.Windows.Controls.Button button onto the form. On its Click event handler, create the SchedulerReportConfigurator class instance and call its SchedulerReportConfigurator.Configure method with the previously specified SchedulerPrintingSettings object passed as a parameter. This will configure the scheduler report (BaseSchedulerPrintingSettings.ReportInstance) by setting its report template and scheduler print adapter to the SchedulerPrintingSettings.ReportTemplatePath and BaseSchedulerPrintingSettings.SchedulerPrintAdapter values respectively.

    Finally, call the PrintHelper.ShowPrintPreviewDialog method with the dialog owner and configured BaseSchedulerPrintingSettings.ReportInstance scheduler report passed as parameters.

Note

To print and preview the SchedulerControl, you need to manually add references to the following libraries:

  • DevExpress.Charts.v18.1.Core
  • DevExpress.PivotGrid.v18.1.Core
  • DevExpress.Sparkline.v18.1.Core
  • DevExpress.XtraCharts.v18.1
  • DevExpress.XtraReports.v18.1
  • DevExpress.XtraScheduler.v18.1
  • DevExpress.XtraScheduler.Reporting.v18.1
Normally, when adding references to these assemblies, you should choose them from the Global Assembly Cache (GAC). However, if you prefer to copy them locally, or need to include them later into your product's installation, you can find copies of them in the following directory:
C:\Program Files (x86)\DevExpress 18.1\Components\Bin\Framework\
To determine assemblies required to deploy the application, use the Assembly Deployment Tool.

The image below shows the scheduler's print preview that is invoked on a button click.

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