Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Printing
' the print document exposes a 'PrintColorStyle' although
' it is up to the implementation to honor this. the default
' appearances and pagesections will honor this setting
Me.UltraPrintDocument1.PrintColorStyle = ColorRenderMode.GrayScale
' the header and footer can have text aligned within
' the section and can include replaceable tokens
Me.UltraPrintDocument1.Header.TextLeft = "[User Name]"
Me.UltraPrintDocument1.Header.TextCenter = Me.UltraPrintDocument1.DocumentName
Me.UltraPrintDocument1.Header.TextRight = "[Date Printed]"
' the header is a derived page section and therefore
' can have a border and control over which sides render
' the border
Me.UltraPrintDocument1.Header.BorderStyle = UIElementBorderStyle.Solid
Me.UltraPrintDocument1.Header.BorderSides = Border3DSide.Bottom
' initialize the text that will appear in the footer.
' this can be replaceable tokens that will insert the
' time, page number, etc.
Me.UltraPrintDocument1.Footer.TextLeft = "[Time Printed]"
Me.UltraPrintDocument1.Footer.TextRight = "[Page #]"
' the height of the section will be calculated automatically
' based on the contents but may be explicitly controlled
' using the height property
'this.ultraPrintDocument1.Footer.Height
' the section text can be setup to switch on
' alternate pages
Me.UltraPrintDocument1.Footer.ReverseTextOnEvenPages = True
' add extra space our the page body
Me.UltraPrintDocument1.PageBody.Margins.Top = 5
Me.UltraPrintDocument1.PageBody.Margins.Bottom = 5
' the page property is the section representing the
' entire renderable area of the page. you can assign
' a border around the margin area
Me.UltraPrintDocument1.Page.BorderStyle = UIElementBorderStyle.Solid
' and then use the padding to provide space between the
' border and contents (header, footer, pagebody)
Me.UltraPrintDocument1.Page.Padding.Left = 2
Me.UltraPrintDocument1.Page.Padding.Right = 2
Me.UltraPrintDocument1.Page.Padding.Top = 2
Me.UltraPrintDocument1.Page.Padding.Bottom = 2
' the appearance of the page will affect only the page itself
Me.UltraPrintDocument1.Page.Appearance.BorderColor = Color.Black
' the appearance property will affect all sections
Me.UltraPrintDocument1.Appearance.ForeColor = Color.Black