Back to Devexpress

SchedulerControl.ShowPrintPreview(SchedulerPrintStyle) Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-showprintpreview-x28-devexpress-dot-xtrascheduler-dot-printing-dot-schedulerprintstyle-x29.md

latest3.8 KB
Original Source

SchedulerControl.ShowPrintPreview(SchedulerPrintStyle) Method

Opens the Print Preview window for the scheduler control’s print output, using the specified print style.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public void ShowPrintPreview(
    SchedulerPrintStyle printStyle
)
vb
Public Sub ShowPrintPreview(
    printStyle As SchedulerPrintStyle
)

Parameters

NameTypeDescription
printStyleSchedulerPrintStyle

A SchedulerPrintStyle object which specifies the print style to be used when printing the Scheduler’s data.

|

Remarks

The Print Preview window displays the scheduler as it will appear when it’s printed. The scheduler can be previewed and printed only if the XtraPrinting Library is available. To verify that printing and previewing the scheduler is possible, use the SchedulerControl.IsPrintingAvailable property.

The Print Preview dialog allows you to print the Scheduler control, or save as PDF or image.

Use this method to print the scheduler’s data using the specified print style. Note that all the available print styles are contained in the SchedulerControl.PrintStyles collection.

Example

csharp
class MyDailyPrintStyle : DevExpress.XtraScheduler.Printing.DailyPrintStyle
{
    public MyDailyPrintStyle()
        : base(false) {
        // Print information on appointments which do not fall in the PrintTime interval.
        base.PrintAllAppointments = true;
        // Hide the reference mini-calendar.
        base.CalendarHeaderVisible = false;
        // Do not use time slots displayed in the Day view of the SchedulerControl.
        base.UseActiveViewTimeScale = false;
        // Determine the row height (specify the time interval of a time slot).
        base.TimeSlots.Clear();
        base.TimeSlots.Add(TimeSpan.FromMinutes(15), "15Minutes");
        // Specify the time interval to print.
        base.PrintTime = new DevExpress.XtraScheduler.TimeOfDayInterval(TimeSpan.FromHours(12), TimeSpan.FromHours(14));
    }

    protected override string DefaultDisplayName
    {
        get
        {
            return "My Daily Style";
        }
    }
}
csharp
schedulerControl1.ShowPrintPreview(new MyDailyPrintStyle());

See Also

ShowPrintPreview

Printing

Printing and Reporting

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace