Version

Printing WinTree

Topic Overview

Purpose

This topic provides a conceptual overview of UltraTree™ printing functionality. Due to the similarity to WinGrid™ printing functionality, read about WinGrid printing in the Required background section is recommended.

Required background

The following topic is a prerequisite to understanding this topic:

Topic Purpose

WinGrid offers several printing options from exporting your grid to a Microsoft® Excel® file or PDF document, to sending your grid to a print preview dialog or printer.

In this topic

This topic contains the following sections:

Overview

WinTree Printing Summary

The WinTree printing feature is intended to provide print preview and print functionalities. The WinTree can be viewed and printed in any of its supported view styles, for example, Standard , OutlookExpress , Grid and FreeForm .

The following screenshot illustrates the print preview of the WinTree (In OutlookExpress view style).

Printing WinTree 1.png

Code Example

This code example requires a project with a WinTree control, if not, refer to WinTree help documentation before continuing the WinTree for print preview or print configuration.

The following code example demonstrates the WinTree for print preview on a button click event.

In C#:

using (var printDoc = new UltraTreePrintDocument())
{
    printDoc.Tree = _ultraTree1;
    using (var previewDialog = new UltraPrintPreviewDialog())
    {
        previewDialog.Document = printDoc;
        previewDialog.ShowDialog(this);
    }
}

In Visual Basic:

Using printDoc As UltraTreePrintDocument = New UltraTreePrintDocument()
printDoc.Tree = _ultraTree1
       Using previewDialog As UltraPrintPreviewDialog = New UltraPrintPreviewDialog()
             previewDialog.Document = printDoc
              previewDialog.ShowDialog(Me)
       End Using
End Using

Call the Print method of UltraTreePrintDocument instead of opening the print preview dialog for printing the WinTree .

In C#:

using (UltraTreePrintDocument printDoc = new UltraTreePrintDocument())
{
    printDoc.Tree = ultraTree1;
    printDoc.Print();
}

In Visual Basic:

Using printDoc As New UltraTreePrintDocument()
      printDoc.Tree = ultraTree1
      printDoc.Print()
End Using

Related Content

Topics

The following topic provides additional information related to this topic.

Topic Purpose

This section contains valuable information about WinTree, ranging from what the control does and why you would want to use it in your application, to step-by-step procedures on how to accomplish a common task using the control.