ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / Print Method / Print(Boolean,Boolean) Method
Specifies whether or not the Print dialog should be shown.
Specifies whether or not the PrintProgress dialog should be shown.
Example

Print(Boolean,Boolean) Method
Initiates the printing process for the currently opened document, allowing for the display of the print dialog and the print progress dialog based on the provided parameters.
Syntax
'Declaration
 
Public Overloads Function Print( _
   ByVal showPrintDialog As Boolean, _
   ByVal showPrintProgressDialog As Boolean _
) As Boolean
 

Parameters

showPrintDialog
Specifies whether or not the Print dialog should be shown.
showPrintProgressDialog
Specifies whether or not the PrintProgress dialog should be shown.

Return Value

Returns true if the printing process is successfully initiated; otherwise, returns false. Note that a return value of true indicates successful initiation of the print job but does not guarantee its completion.
Remarks
This method offers flexibility in the printing process by allowing the user to choose whether to display the print dialog and the print progress dialog. It is useful for scenarios where either direct printing with default settings is desired or user intervention is required to select specific printer settings.
Example
// Assuming 'viewer' is an instance of the Viewer class
// This will print the document silently without showing the print dialog or the print progress dialog
bool printSuccess = viewer.Print(showPrintDialog: false, showPrintProgressDialog: false);
if (printSuccess)
    MessageBox.Show("Printing initiated successfully.");
else
    MessageBox.Show("Printing failed.");
See Also