[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [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]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
    [Collapse]Basic Terms
      Printing System
      Printing Links
      Document Sections
      Brick Graphics
    [Expand]Print Preview
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Printing Links

This topic provides an overview of the various approaches to create documents using printing links.

Among the different approaches to rendering documents from a component's content, the easiest is to use a unified printing procedure, which is a printing link that transforms a control's data into Bricks of appropriate types, and arranges them into a printing document. You can use a printing link to print a non-visual component (such as a dataset) as well.

To print an object using a link at design time within Visual Studio, do the following.

  1. Drop the DocumentViewer component from the DX.19.2: Reporting Toolbox tab onto the main form of your application.

  2. To add a printing system to the print preview, select the DocumentViewer control and click its smart tag. Next, expand the Document Source property drop-down list, and select the PrintingSystem item in the Standard Sources category.

    This will add a new printing system to the application and assign it to the DocumentViewer.DocumentSource property of the document viewer.

  3. To add a printing link of the required type to the PrintingSystem.Links collection, select the printing system in the component tray, click its smart tag, and click the ellipsis button for the Links property in the invoked actions list.

  4. In the invoked Link Collection Editor, click Add and select the required link type from the drop-down list.

    For example, to print a DevExpress control (such as GridControl, PivotGridControl or RichEditControl), select PrintableComponentLink. To create a single document from multiple individual controls, you can combine multiple links into a CompositeLink. To learn about the available link types, see Document Creation Approaches.

  5. A property for associating an object with a link depends on the link type (e.g., the DataGridLink exposes the DataGridLinkBase.DataGrid property, and the PrintableComponentLinkBase exposes the PrintableComponentLinkBase.Component property).

    The printing system will then render a component's content to a document that is ready to preview, print and/or export.

To trigger document generation in code, call the Link.CreateDocument, Link.ShowPreview or Link.Print method.

To insert printing bricks into an existing document, use the corresponding methods of the BrickGraphics class. The Link will automatically associate the necessary brick types, so the BrickGraphics class creates compatible bricks and adds them to the document. For more information, refer to Brick Graphics.

Expanded See Also

Is this topic helpful?​​​​​​​