Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Expand]Data Binding
    [Expand]Nodes
    [Expand]Data Editing
    [Expand]Data Representation
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
    [Collapse]Miscellaneous
     [Expand]Context Menus
     [Expand]Export and Import Data
     [Collapse]Print XtraTreeList
       Customize Print Appearances
       Customize TreeList Print Settings
       Printing Basics
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Printing Basics

This topic covers how to print a Tree List layout and show a print preview for the control.

The TreeList.ShowPrintPreview and TreeList.ShowRibbonPrintPreview methods open a window with print commands and a print preview of the current Tree List control. When using the first method, the print commands are displayed using the Bars UI, while the second method displays the print commands using a Ribbon UI. Using the Preview window, an end-user is able to customize the page settings (the page format, margins and orientation), provide a background image for pages, specify which Tree List elements must be printed, export the Tree List to various formats (PDF, HTML. XLS, Image, etc), and so on.

The TreeList.Print method prints the Tree List control immediately, without showing a preview, using the default page settings. Before calling this method, you can specify which Tree List elements must be printed. To do this, use the properties provided by the TreeList.OptionsPrint object. This object also provides settings that specify whether to expand nodes before printing, whether columns must be stretched to fit the page width, etc.

You can also use the TreeList.PrintDialog method to display the standard Print dialog, which allows you to select a printer and its settings, and then start or cancel the print operation.

The TreeList.ShowPrintPreview, TreeList.ShowRibbonPrintPreview and TreeList.Print methods provide basic printing capabilities. For information on advanced printing capabilities (e.g., setting the paper size and margins beforehand, add headers and footers to the printout, etc.), see How to: Set Paper Format and Add Custom Information to the Report when Printing/Exporting a Control.

Expanded Example

The following example demonstrates how to print a TreeList with the TreeList.Print method, and show its print preview with the TreeList.ShowRibbonPrintPreview method.

The image below shows the Preview window for a sample Tree List control. The print commands provided by this window are displayed using a Ribbon UI.

Expanded See Also

How would you rate this topic?​​​​​​​