Skip to main content

SchedulerPrintStyle Class

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

Namespace: DevExpress.XtraScheduler.Printing

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public abstract class SchedulerPrintStyle :
    UserInterfaceObject,
    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.

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

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

See Also