ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(PageDocument) Method
The page document to print. This document contains the content and layout information for the print job.
Example

In This Topic
    Print(PageDocument) Method
    In This Topic
    Initiates the printing process for a page-based document with default settings.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Print( _
       ByVal pageDocument As PageDocument _
    ) As Boolean
    public static bool Print( 
       PageDocument pageDocument
    )

    Parameters

    pageDocument
    The page document to print. This document contains the content and layout information for the print job.

    Return Value

    Returns true if the print operation completes successfully; otherwise, returns false. A return value of false may indicate that the user cancelled the print job or that an error occurred during printing.
    Remarks
    This method simplifies the printing process by using default settings, which include displaying the print dialog to the user, showing a print progress dialog during the printing process, and executing the print job on a separate thread to maintain UI responsiveness. It is designed for ease of use in common printing scenarios.
    Example
    The following example demonstrates how to print a page document using the default settings:
    var pageReport = new PageReport();
    PageDocument pageDocument = new PageDocument(pageReport);
    bool printSuccess = pageDocument.Print();
    if (printSuccess)
    	Console.WriteLine("Printing completed successfully.");
    else
    	Console.WriteLine("Printing failed.");
    See Also