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.
The following topic is a prerequisite to understanding this topic:
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).
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
The following topic provides additional information related to this topic.