ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(SectionDocument,Boolean,Boolean) Method
The section document to be printed.
Specifies whether the print dialog should be shown to the user. If true, the print dialog is displayed, allowing the user to select printer settings.
Specifies whether the print progress dialog should be shown during the printing process. If true, the progress dialog is displayed, providing feedback about the printing status.
Example

In This Topic
    Print(SectionDocument,Boolean,Boolean) Method
    In This Topic
    Initiates the printing process for a section-based document, with options to display the print dialog and the print progress dialog.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Print( _
       ByVal sectionDocument As SectionDocument, _
       ByVal showPrintDialog As Boolean, _
       ByVal showPrintProgressDialog As Boolean _
    ) As Boolean

    Parameters

    sectionDocument
    The section document to be printed.
    showPrintDialog
    Specifies whether the print dialog should be shown to the user. If true, the print dialog is displayed, allowing the user to select printer settings.
    showPrintProgressDialog
    Specifies whether the print progress dialog should be shown during the printing process. If true, the progress dialog is displayed, providing feedback about the printing status.

    Return Value

    true if the print operation completes successfully; otherwise, false.
    Remarks
    This method offers more control over the printing process by allowing the user to decide whether to display the print dialog and the print progress dialog. It defaults to using the printing thread for the operation, ensuring that the UI remains responsive during printing.
    Example
    The following example demonstrates how to print a section document with both the print dialog and the print progress dialog displayed:
    SectionDocument sectionDocument = new SectionDocument();
    sectionDocument.Load("C:\\Report.rdf");
    bool printSuccess = sectionDocument.Print(showPrintDialog: true, showPrintProgressDialog: true);
    if (printSuccess)
        Console.WriteLine("Printing completed successfully.");
    else
        Console.WriteLine("Printing failed.");
    See Also