Back to Devexpress

SchedulerPrintStyle Class

windowsforms-devexpress-dot-xtrascheduler-dot-printing-84076b6a.md

latest4.1 KB
Original Source

SchedulerPrintStyle Class

A print style used to print the Scheduler’s data.

Namespace : DevExpress.XtraScheduler.Printing

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public abstract class SchedulerPrintStyle :
    UserInterfaceObject,
    ICaptionSupport,
    ICloneable,
    IDisposable
vb
Public MustInherit Class SchedulerPrintStyle
    Inherits UserInterfaceObject
    Implements ICaptionSupport,
               ICloneable,
               IDisposable

The following members return SchedulerPrintStyle objects:

Remarks

The SchedulerPrintStyle class contains members which allow the appearance of the scheduler’s data being printed to be customized. The currently active print style can be accessed via the SchedulerControl.ActivePrintStyle property of the Scheduler Control, and all the available print styles are stored in the collection returned via the SchedulerControl.PrintStyles property.

To print a Scheduler’s data using the currently active print style, use the SchedulerControl.Print method. To invoke the print preview window, use the SchedulerControl.ShowPrintPreview method.

csharp
DailyPrintStyle printStyle = (DailyPrintStyle)schedulerControl1.PrintStyles[SchedulerPrintStyleKind.Daily];
printStyle.UseActiveViewTimeScale = true;
printStyle.PrintTime.Start = schedulerControl1.SelectedInterval.Start.TimeOfDay;
printStyle.PrintTime.End = schedulerControl1.SelectedInterval.End.TimeOfDay;
if ((this.schedulerControl1.DayView.TimeScale.Hours < 1) || (printStyle.PrintTime.Duration.TotalHours > 4))
{
    printStyle.CalendarHeaderVisible = false;
    printStyle.AutoScaleHeadingsFont = false;
    printStyle.HeadingsFont = new Font("Verdana", 8);
    printStyle.AppointmentFont = new Font("Verdana", 8);
}
schedulerControl1.ShowPrintPreview(printStyle);
schedulerControl1.PrintStyles.LoadDefaults();

Example

csharp
WeeklyPrintStyle printStyle = (WeeklyPrintStyle)this.schedulerControl1.PrintStyles[SchedulerPrintStyleKind.Weekly];
printStyle.ArrangeDays = ArrangeDaysKind.LeftToRight;
printStyle.PrintTime.Start = new TimeSpan(8, 0, 0);
printStyle.PrintTime.End = new TimeSpan(18, 0, 0);
printStyle.PrintWeekends = false;
printStyle.AppointmentFont = new Font("Verdana", 8);
schedulerControl1.ShowPrintPreview(printStyle);
schedulerControl1.PrintStyles.LoadDefaults();

Inheritance

Object UserInterfaceObject SchedulerPrintStyle DailyPrintStyle

See Also

SchedulerPrintStyle Members

ShowPrintPreview

Printing

Printing and Reporting

DevExpress.XtraScheduler.Printing Namespace