ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(PageDocument,Boolean,Boolean,Boolean) Method
The GrapeCity.ActiveReports.Document.PageDocument instance to be printed. This document contains the content and layout information for the print job.
Specifies whether the print dialog should be shown to the user. If set to true, the print dialog allows the user to modify printer settings such as the printer to use, the range of pages to print, and the number of copies. If false, the document is printed directly with the current printer settings without user interaction.
Specifies whether the print progress dialog should be displayed during the printing process. If set to true, the progress dialog provides feedback about the printing status to the user. If false, no progress dialog is shown.
Determines whether the printing process should be executed on a new thread. Using a separate thread for printing can help maintain UI responsiveness during the print job. If set to true, the printing is performed on a new thread; if false, it is performed on the current thread.
Example

In This Topic
    Print(PageDocument,Boolean,Boolean,Boolean) Method
    In This Topic
    Initiates the printing process for a page-based document, providing options to display the print dialog, the print progress dialog, and to execute the printing on a new thread.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Print( _
       ByVal pageDocument As PageDocument, _
       ByVal showPrintDialog As Boolean, _
       ByVal showPrintProgressDialog As Boolean, _
       ByVal usePrintingThread As Boolean _
    ) As Boolean

    Parameters

    pageDocument
    The GrapeCity.ActiveReports.Document.PageDocument instance to be printed. This document contains the content and layout information for the print job.
    showPrintDialog
    Specifies whether the print dialog should be shown to the user. If set to true, the print dialog allows the user to modify printer settings such as the printer to use, the range of pages to print, and the number of copies. If false, the document is printed directly with the current printer settings without user interaction.
    showPrintProgressDialog
    Specifies whether the print progress dialog should be displayed during the printing process. If set to true, the progress dialog provides feedback about the printing status to the user. If false, no progress dialog is shown.
    usePrintingThread
    Determines whether the printing process should be executed on a new thread. Using a separate thread for printing can help maintain UI responsiveness during the print job. If set to true, the printing is performed on a new thread; if false, it is performed on the current thread.

    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 the printing process.
    Remarks
    This method is designed to provide a flexible and user-friendly interface for printing page-based documents within the GrapeCity ActiveReports framework. It allows for customization of the printing process through various parameters, catering to different user preferences and requirements.
    Example
    var report = new PageReport(new FileInfo(@"C:\Report.rdlx"));
    var doc = report.Document;
    doc.PrintOptions.Watermark = new WatermarkOptions
    {
    	Title = "Watermark",
    	Angle = 45,
    	Color = Color.Red,
    	Font = new Font("Arial", 72),
    	DrawOver = true
    };
    var result = doc.Print(false, true, false);
    See Also