ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Common Assembly / GrapeCity.ActiveReports Namespace / PrintExtension Class / Print Method / Print(SectionDocument,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.
Example

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

    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.

    Return Value

    true if the print operation completes successfully; otherwise, false.
    Remarks
    This method allows for basic customization of the printing process by controlling the visibility of the print dialog. It defaults to showing the print progress dialog and using the printing thread for the operation, simplifying the printing process for common use cases.
    Example
    The following example demonstrates how to print a section document with the print dialog:
    SectionDocument sectionDocument = new SectionDocument();
    sectionDocument.Load("C:\\Report.rdf");
    bool printSuccess = sectionDocument.Print(showPrintDialog: true);
    if (printSuccess)
        Console.WriteLine("Printing completed successfully.");
    else
        Console.WriteLine("Printing failed.");
    See Also