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
  [Expand]Tree List
  [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
  [Collapse]Printing-Exporting
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
   [Expand]Concepts
   [Collapse]Examples
    [Collapse]Print Preview
      How to: Add a Print Preview to a Windows Forms Application
      How to: Preview, Export and Print a Windows Forms Control
      How to: Preview, Export and Print an XtraReport
      How to: Preview, Export and Print a Remotely Created Document
      How to: Show a Progress Bar during Document Generation
      How to: Execute Commands in the Print Preview
      How to: Change The Visibility of Toolbar Buttons and Menu Items in the Print Preview
      How to: Customize How a Document Is Exported from the Print Preview
      How to: Hide some of the Export Options in the Print Preview
      How to: Change the Measurement System Exposed in the Print Preview
    [Expand]Using Bricks
    [Expand]Using Printing Links
    [Expand]Page Header and Footer
    [Expand]Printing DevExpress Controls
    [Expand]Exporting
    [Expand]Miscellaneous
  [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

How to: Add a Print Preview to a Windows Forms Application

This document describes the steps required to provide a Windows Forms Application with print preview capability, to display printable documents from different sources.

To create a print preview, do the following.

  1. Run Visual Studio 2010, 2012, 2013, 2015 or 2017, and create a new Windows Forms Application.

  2. To add a print preview to your application, switch to the application's main form in Visual Studio, and press CTRL+ALT+X to open the Toolbox. Next, drag the DocumentViewer control from the DX.17.1: Reporting category and drop it onto the form.

  3. Click the smart tag of the control, and in the invoked actions list, select a toolbar that matches the user interface style of your application. In this tutorial, the Ribbon toolbar is used.

  4. To assign a document source to the Document Viewer, click its smart tag again and in the drop-down menu of the DocumentViewer.DocumentSource property, select the option that meets your requirements.

    To learn how to assign different document sources, proceed with the following topics:

    - How to: Preview, Export and Print a Windows Forms Control

    - How to: Preview, Export and Print an XtraReport

    - How to: Preview, Export and Print a Remotely Created Document

The following image illustrates a Document Viewer with no document source assigned to it.

Expanded See Also

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