Document Creation Approaches

  • 3 minutes to read

This topic demonstrates how you can print and/or export a visual control or a non-visual component using printing links added to a Printing System collection.

This topic consists of the following sections.

Print Standard Windows Forms Controls

To print standard Windows Forms controls, the XtraPrinting Library provides the following standard link types (all deriving from the base Link class).

For code samples, see How to: Print a TreeView Control and How to: Print a DataGrid Control.

Print DevExpress Controls

The following DevExpress controls implement the IPrintable interface and can be printed using the PrintableComponentLink.

The following web controls implement the IPrintable interface and can be directly exported to a stream or response in various document formats using the methods of their corresponding exporter objects.

ASP.NET WebForms Control Exporter
ASPxGridView ASPxGridViewExporter
ASPxCardView ASPxCardViewExporter
ASPxVerticalGrid ASPxVerticalGridExporter
ASPxPivotGrid ASPxPivotGridExporter
ASPxTreeList ASPxTreeListExporter
ASP.NET MVC Control Exporter
MVCxGridView MVCxGridViewExporter
MVCxPivotGrid MVCxPivotGridExporter
MVCxTreeList MVCxTreeListExporter
MVCxCardView MVCxCardViewExporter
MVCxVerticalGrid MVCxVerticalGridExporter

For more information, see How to: Use the PrintableComponentLink to Print DevExpress Controls.

Print Custom Components

To print your custom component using Printing System, this component should implement the IPrintable interface, after which you can print it using the PrintableComponentLink class.

For more information, see How to: Create a Printable ListView Descendant Implementing the IPrintable Interface.

Additional Customization

The Link class provides a set of events, each intended to create a specific document section.

In any of these event handlers, you can customize the CreateAreaEventArgs.Graph property, which provides access to a Brick Graphics object that is used to create bricks of different types.

Handle these events in the following order to create and/or modify your document sections.

After finishing modifying document sections, call the Link.CreateDocument method (to create a paginated document that is ready to be previewed, printed or exported) or the Link.ShowPreview method (which creates a document and then shows it in a Print Preview form).

For more information, see How to: Use Link Events (Complete Sample).

See Also