PrintableComponentLink Class
A link to print and export components that implement the IPrintable interface.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.XtraPrinting.v24.2.dll
Declaration
Remarks
PrintableComponentLink is a link to print/export any component that supports the IPrintable interface. This component is specified by the link’s PrintableComponentLinkBase.Component property.
A control’s export using a PrintableComponentLink is performed in WYSIWYG export mode. Certain controls (e.g., GridControl) can be exported to XLS-XLSX formats in data-aware export mode. In data-aware mode, optimized for subsequent analysis of grid data within Microsoft Excel, various data shaping options that are applied within a source control are retained in output XLS-XLSX documents. See Export to XLS and XLSX Formats to learn more.
Afterwards, you can create a document and either show its Print Preview (by calling the PrintableComponentLink.ShowPreview or PrintableComponentLink.ShowPreviewDialog method), or print it (by calling the PrintableComponentLink.Print or PrintableComponentLink.PrintDlg method).
The following DevExpress controls support the IPrintable interface.
- ChartControl;
- GridControl;
- LayoutControl;
- PivotGridControl;
- RichEditControl;
- SchedulerControl;
- SpreadsheetControl;
- TreeList.
Some controls (like RichEditControl) will ignore the page options provided by the corresponding printing links and use their own page options, instead.
For code samples, see the following resources:
- How to: Use the PrintableComponentLink to Print DevExpress Controls
How to: Create a Printable ListView Descendant Implementing the IPrintable Interface
(An implementation of the IPrintable interface for a custom control, to print and export it using the PrintableComponentLink class.)