Skip to main content

Printing Links

  • 3 minutes to read

This topic explains what the printing links are and how they are used to create documents that are ready to be previewed, printed and exported.

This topic consists of the following sections.

#Links Overview

DXPrinting creates documents by linking data with templates (DataTemplate).

Printing_Links

Depending on data provider, templates are either provided by a link or by an associated control (e.g. when printing DevExpress grids).

After creating a printing link, it should be assigned to an appropriate view model (the DocumentPreviewModelBase class descendant), which is then assigned to a Document Viewer, from where it can be printed and exported.

#Using Links to Print Data

To create a document and show it in a Document Preview, perform the following steps.

  1. Create a link according to the type of data (SimpleLink, CollectionViewLink or PrintableControlLink);
  2. Assign the link to a corresponding view model (LinkPreviewModel or );
  3. Assign the model to the DocumentViewer.Model property;
  4. Call the LinkBase.CreateDocument method.

All link types derive from the LinkBase class. From it, derives the TemplatedLink class that defines templates for the following document sections (that are similar to report bands in XtraReports).

#Link Types

The following link types are available in DXPrinting.

Note that apart from using pre-defined link types, you can create custom types inherited from the LinkBase class.

See Also