Back to Devexpress

PrintToolBase.Print(String) Method

corelibraries-devexpress-dot-xtraprinting-dot-printtoolbase-dot-print-x28-system-dot-string-x29.md

latest3.3 KB
Original Source

PrintToolBase.Print(String) Method

Prints the current document on the specified printer.

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public void Print(
    string printerName
)
vb
Public Sub Print(
    printerName As String
)

Parameters

NameTypeDescription
printerNameString

A String representing the name of the printer on which the current document should be printed.

|

Remarks

This method sends a report assigned to the PrintToolBase to the specified 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.

Note

If a printer with the specified name isn’t found, this method throws an InvalidPrinterException.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Print(String) 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.

word-document-api-use-printablecomponentlink-to-print-document/CS/PrintingSystem/Form1.cs#L75

csharp
PrintToolBase tool = new PrintToolBase(ps);
    tool.Print(printerName);
}

word-document-api-use-printablecomponentlink-to-print-document/VB/PrintingSystem/Form1.vb#L74

vb
Dim tool As PrintToolBase = New PrintToolBase(ps)
    tool.Print(printerName)
End Using

See Also

PrintToolBase Class

PrintToolBase Members

DevExpress.XtraPrinting Namespace