Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PrintTool Class

The base class for the ReportPrintTool class.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.XtraPrinting.v24.2.dll

NuGet Package: DevExpress.Win.Printing

#Declaration

public class PrintTool :
    PrintToolBase,
    IDisposable

#Remarks

The PrintTool class exposes the PrintToolBase.PrintingSystem property that allows you to access a Print Tool’s printing options, and the PrintTool.PreviewForm and PrintTool.PreviewRibbonForm properties that provide access to the options of its Print Preview form.

#Example

This example shows how you can print a Windows Forms control (e.g. GridControl) using PrintTool.

using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
// ...
private void simpleButton1_Click(object sender, EventArgs e) {
    PrintableComponentLink componentLink = new PrintableComponentLink(new PrintingSystem());
    componentLink.Component = gridControl1;
    componentLink.CreateDocument();
    PrintTool pt = new PrintTool(componentLink.PrintingSystemBase);
    pt.ShowPreviewDialog();
}
See Also