Version

UltraSchedulePrintDocument Class

Component for rendering the calendar information of an UltraCalendarInfo to the printer.
Syntax
'Declaration
 
Public Class UltraSchedulePrintDocument 
   Inherits Infragistics.Win.Printing.UltraPrintDocument
public class UltraSchedulePrintDocument : Infragistics.Win.Printing.UltraPrintDocument 
Remarks

The UltraSchedulePrintDocument component is used to print the contents of an associated CalendarInfo. The type of output is based on the PrintStyle property, which can be one of seven different types. The information that is printed is based on the PrintRange. When this property is set to SpecifiedDateRange, the output is limited by the StartDate and EndDate property values. When set to Selection and printing a Memo report, the SelectedAppointments is used to provide the appointments that will be printed. Otherwise, the SelectedDateRanges property determines the print range.

Since several of the print styles, require output analogous to the controls included with UltraWinSchedule, the component creates instances of the controls as required for the print operation. The component also exposes several "template" control properties. When a control is created for the print operation, the properties of the corresponding "template" control are copied to the control created by the print document. In addition, the component exposes additional events to allow these controls to be initialized. For example, when an UltraDayView style output is being generated, an UltraDayView is created by the print document; if the TemplateDayView property is set, the properties of that control that do not conflict with the requirements for the print operation are copied over to the newly created control. Subsequently, the InitializeDayView event is invoked to allow any further modification of the control.

Example
The following example demonstrates how to initialize some of the main properties of the UltraSchedulePrintDocument.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' the CalendarInfo property provides the source of the
        ' activity information, owners, etc. that will be printed
        ' and is commonly set to the same UltraCalendarInfo 
        ' associated with the winschedule controls (e.g. UltraDayView,
        ' UltraWeekView, etc.) displaying the information to the
        ' end user
        Me.ultraSchedulePrintDocument1.CalendarInfo = Me.ultraCalendarInfo1

        ' the CalendarLook is used to initialize the CalendarInfo
        ' properties of the controls created for the print operation.
        ' setting this to the same instance that is referenced by 
        ' the controls on the form will allow the print output
        ' to more closely match the view displayed by the controls
        ' on the form
        Me.ultraSchedulePrintDocument1.CalendarLook = Me.ultraCalendarLook1

        ' the "template" properties are used to initialize the
        ' properties of the controls created for the print operation
        ' and make it easier to print in a wysiwyg fashion. the
        ' settings may be further tweaked using the "Initialize" events
        ' of the UltraSchedulePrintDocument.
        Me.ultraSchedulePrintDocument1.TemplateDayView = Me.ultraDayView1
        Me.ultraSchedulePrintDocument1.TemplateMonthViewMulti = Me.ultraMonthViewMulti1
        Me.ultraSchedulePrintDocument1.TemplateMonthViewSingle = Me.ultraMonthViewSingle1
        Me.ultraSchedulePrintDocument1.TemplateWeekView = Me.ultraWeekView1

        ' the TemplateDateHeaderMonthViewMulti control is the control
        ' used to render the months in the date header area and is separate
        ' from the TemplateMonthViewMulti which is used to initialize
        ' the mvm used when printing a full year of data on a single page.
        ' it is not often necessary to assign this template control
        'this.ultraSchedulePrintDocument1.TemplateDateHeaderMonthViewMulti = this.ultraMonthViewMulti1;

        ' the 'PrintStyle' property determines the type of view
        ' that will be printed. note that depending on the print style
        ' some properties on the control created for the print
        ' operation may be overriden
        Me.ultraSchedulePrintDocument1.PrintStyle = SchedulePrintStyle.TriFold

        ' also, depending on the print style some properties of 
        ' the UltraSchedulePrintDocument will be available to 
        ' control the print operation. 
        ' print a single page per owner
        Me.ultraSchedulePrintDocument1.TriFoldLayoutStyle = TriFoldLayoutStyle.PagePerOwner

        ' in a trifold print style, the primary factor that determines how
        ' many pages are printed is based on what is the most limiting
        ' section type. in the following example, the weekly print style
        ' is the most limiting and a separate page will be printed per week
        Me.ultraSchedulePrintDocument1.TriFoldStyleLeft = TriFoldSectionStyle.Monthly
        Me.ultraSchedulePrintDocument1.TriFoldStyleCenter = TriFoldSectionStyle.Weekly
        Me.ultraSchedulePrintDocument1.TriFoldStyleRight = TriFoldSectionStyle.CalendarInfoNotesArea

        ' the 'PrintRange' property controls the range of information
        ' that will be printed. by default, the print will be based
        ' on the selection (selectedappointments for a memo style) and
        ' selected date ranges for all other print styles.
        Me.ultraSchedulePrintDocument1.PrintRange = SchedulePrintRange.SpecifiedDateRange

        ' when using a 'SpecifiedDateRange' print range, the 
        ' StartDate and EndDate properties should be set
        Me.ultraSchedulePrintDocument1.StartDate = DateTime.Today
        Me.ultraSchedulePrintDocument1.EndDate = DateTime.Today.AddMonths(3)
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void Form1_Load(object sender, System.EventArgs e)
		{
			// the CalendarInfo property provides the source of the
			// activity information, owners, etc. that will be printed
			// and is commonly set to the same UltraCalendarInfo 
			// associated with the winschedule controls (e.g. UltraDayView,
			// UltraWeekView, etc.) displaying the information to the
			// end user
			this.ultraSchedulePrintDocument1.CalendarInfo = this.ultraCalendarInfo1;

			// the CalendarLook is used to initialize the CalendarInfo
			// properties of the controls created for the print operation.
			// setting this to the same instance that is referenced by 
			// the controls on the form will allow the print output
			// to more closely match the view displayed by the controls
			// on the form
			this.ultraSchedulePrintDocument1.CalendarLook = this.ultraCalendarLook1;

			// the "template" properties are used to initialize the
			// properties of the controls created for the print operation
			// and make it easier to print in a wysiwyg fashion. the
			// settings may be further tweaked using the "Initialize" events
			// of the UltraSchedulePrintDocument.
			this.ultraSchedulePrintDocument1.TemplateDayView = this.ultraDayView1;
			this.ultraSchedulePrintDocument1.TemplateMonthViewMulti = this.ultraMonthViewMulti1;
			this.ultraSchedulePrintDocument1.TemplateMonthViewSingle = this.ultraMonthViewSingle1;
			this.ultraSchedulePrintDocument1.TemplateWeekView = this.ultraWeekView1;

			// the TemplateDateHeaderMonthViewMulti control is the control
			// used to render the months in the date header area and is separate
			// from the TemplateMonthViewMulti which is used to initialize
			// the mvm used when printing a full year of data on a single page.
			// it is not often necessary to assign this template control
			//this.ultraSchedulePrintDocument1.TemplateDateHeaderMonthViewMulti = this.ultraMonthViewMulti1;

			// the 'PrintStyle' property determines the type of view
			// that will be printed. note that depending on the print style
			// some properties on the control created for the print
			// operation may be overriden
			this.ultraSchedulePrintDocument1.PrintStyle = SchedulePrintStyle.TriFold;

			// also, depending on the print style some properties of 
			// the UltraSchedulePrintDocument will be available to 
			// control the print operation. 
			// print a single page per owner
			this.ultraSchedulePrintDocument1.TriFoldLayoutStyle = TriFoldLayoutStyle.PagePerOwner;

			// in a trifold print style, the primary factor that determines how
			// many pages are printed is based on what is the most limiting
			// section type. in the following example, the weekly print style
			// is the most limiting and a separate page will be printed per week
			this.ultraSchedulePrintDocument1.TriFoldStyleLeft = TriFoldSectionStyle.Monthly;
			this.ultraSchedulePrintDocument1.TriFoldStyleCenter = TriFoldSectionStyle.Weekly;
			this.ultraSchedulePrintDocument1.TriFoldStyleRight = TriFoldSectionStyle.CalendarInfoNotesArea;

			// the 'PrintRange' property controls the range of information
			// that will be printed. by default, the print will be based
			// on the selection (selectedappointments for a memo style) and
			// selected date ranges for all other print styles.
			this.ultraSchedulePrintDocument1.PrintRange = SchedulePrintRange.SpecifiedDateRange;

			// when using a 'SpecifiedDateRange' print range, the 
			// StartDate and EndDate properties should be set
			this.ultraSchedulePrintDocument1.StartDate = DateTime.Today;
			this.ultraSchedulePrintDocument1.EndDate = DateTime.Today.AddMonths(3);
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also