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
   [Collapse]Concepts
    [Collapse]Basic Terms
      Printing System
      Bricks
      Printing Links
      Document Sections
      Brick Graphics
    [Expand]Print Preview
    [Expand]Exporting
    [Expand]Miscellaneous
   [Expand]Examples
  [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]ASP.NET Core 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]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.17.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

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