Back to Devexpress

PrintToolBase.Print() Method

corelibraries-devexpress-dot-xtraprinting-dot-printtoolbase-e5763ab3.md

latest4.3 KB
Original Source

PrintToolBase.Print() Method

Prints the current document on the default printer.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public void Print()
vb
Public Sub Print

Remarks

This method immediately sends a report assigned to the PrintToolBase to the default printer.

The document to be printed is accessible via the PrintingSystemBase.Document property of the PrintToolBase.PrintingSystem. Note that you need to call the XtraReport.CreateDocument method to generate a document prior to calling the Print method.

To send a report to a different printer, use the overloaded Print(String) method with the printerName parameter.

To support server printing on Linux, install the libcups library. See Printing in Reporting Tools for Web for details.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Print() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-print-a-report-without-displaying-a-preview/CS/EFCore/InstantReportEF/InstantReportEF.Blazor.Server/Controllers/BlazorPrintContactsController.cs#L17

csharp
PrintToolBase tool = new PrintToolBase(report.PrintingSystem);
    tool.Print();
}

reporting-wpf-override-print-commands/CS/MinimalisticReportPreviewDemo/MyDocumentPreviewControl.cs#L16

csharp
pt.PrintingSystem.PrintProgress += new PrintProgressEventHandler(PrintingSystem_PrintProgress);
    pt.Print();
}

reporting-winforms-print-reports-in-batch/CS/BatchPrinting/Form1.cs#L31

csharp
ReportPrintTool pts = new ReportPrintTool(report);
    pts.Print();
}

reporting-wpf-override-print-commands/VB/MinimalisticReportPreviewDemo/MyDocumentPreviewControl.vb#L20

vb
AddHandler pt.PrintingSystem.PrintProgress, New PrintProgressEventHandler(AddressOf PrintingSystem_PrintProgress)
    pt.Print()
End Sub

reporting-winforms-print-reports-in-batch/VB/BatchPrinting/Form1.vb#L36

vb
Dim pts As New ReportPrintTool(report)
    pts.Print()
Next report

See Also

PrintToolBase Class

PrintToolBase Members

DevExpress.XtraPrinting Namespace