ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(SectionDocument,Boolean,Boolean,Boolean) Method
The section document to be printed. This document contains the content and layout information for the print job.
Specifies whether to display the print dialog before printing. If set to true, the print dialog is shown, allowing the user to select printer settings and preferences.
Specifies whether to display a print progress dialog during the printing process. If set to true, a dialog providing feedback on the printing progress is displayed to the user.
Determines whether the printing process should be executed on a separate thread. If set to true, printing is performed on a background thread, which can help maintain UI responsiveness during the print operation.
Example

In This Topic
    Print(SectionDocument,Boolean,Boolean,Boolean) Method
    In This Topic
    Initiates the printing process for a section-based document with options for displaying print dialogs and controlling the printing execution thread.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Print( _
       ByVal sectionDocument As SectionDocument, _
       ByVal showPrintDialog As Boolean, _
       ByVal showPrintProgressDialog As Boolean, _
       ByVal usePrintingThread As Boolean _
    ) As Boolean

    Parameters

    sectionDocument
    The section document to be printed. This document contains the content and layout information for the print job.
    showPrintDialog
    Specifies whether to display the print dialog before printing. If set to true, the print dialog is shown, allowing the user to select printer settings and preferences.
    showPrintProgressDialog
    Specifies whether to display a print progress dialog during the printing process. If set to true, a dialog providing feedback on the printing progress is displayed to the user.
    usePrintingThread
    Determines whether the printing process should be executed on a separate thread. If set to true, printing is performed on a background thread, which can help maintain UI responsiveness during the print operation.

    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 provides a flexible approach to printing section-based documents, allowing for user interaction through dialogs and improved application performance by optionally running the print job on a separate thread. It is part of the GrapeCity ActiveReports printing extensions and is designed to integrate seamlessly with the ActiveReports reporting components.
    Example
    var doc = new SectionDocument();
    doc.Load("C:\\Report.rdf");
    doc.PrintOptions.PrintPageBorder = true;
    doc.PrintOptions.Watermark = new WatermarkOptions
    {
    	Title = "Watermark",
    	Angle = 45,
    	Color = Color.Gray,
    	Font = new Document.Drawing.Font("Arial", 72)
    };
    var result = doc.Print(false, true, false);
    See Also