ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(PageDocument,PrintingSettings) Method
The GrapeCity.ActiveReports.Document.PageDocument instance representing the document to be printed. This document contains the content and layout information for the print job.
A GrapeCity.Viewer.Common.PrintingSettings enumeration that specifies the printing options such as whether to show the print dialog, the print progress dialog, use a printing thread, and the style of the dialog. This allows for granular control over the printing process.
Example

In This Topic
    Print(PageDocument,PrintingSettings) Method
    In This Topic
    Initiates the printing process for a page-based document, allowing for detailed control over the printing settings.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Print( _
       ByVal pageDocument As PageDocument, _
       ByVal printingSettings As PrintingSettings _
    ) As Boolean
    public static bool Print( 
       PageDocument pageDocument,
       PrintingSettings printingSettings
    )

    Parameters

    pageDocument
    The GrapeCity.ActiveReports.Document.PageDocument instance representing the document to be printed. This document contains the content and layout information for the print job.
    printingSettings
    A GrapeCity.Viewer.Common.PrintingSettings enumeration that specifies the printing options such as whether to show the print dialog, the print progress dialog, use a printing thread, and the style of the dialog. This allows for granular control over the printing process.

    Return Value

    A System.Boolean value indicating the success of the print operation. 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 the printing process.
    Remarks
    This method provides an advanced interface for printing page-based documents within the GrapeCity ActiveReports framework, leveraging the GrapeCity.Viewer.Common.PrintingSettings enumeration to customize the printing experience. It is designed to cater to various printing preferences and scenarios, offering flexibility in how the print job is executed.
    Example
    The following example demonstrates how to print a page document with customized printing settings:
    var pageReport = new PageReport();
    PageDocument pageDocument = new PageDocument(pageReport);
    PrintingSettings settings = PrintingSettings.UseStandardDialog | PrintingSettings.ShowPrintDialog;
    bool printSuccess = pageDocument.Print(settings);
    if (printSuccess)
        Console.WriteLine("Printing completed successfully.");
    else
    	Console.WriteLine("Printing failed.");
    See Also