Progress® Telerik® Reporting R3 2017

ReportViewerBasePrintBegin Event

Occurs when the report in the viewer control starts printing.

Namespace:  Telerik.ReportViewer.WinForms
Assembly:  Telerik.ReportViewer.WinForms (in Telerik.ReportViewer.WinForms.dll)

Syntax

public event PrintBeginEventHandler PrintBegin

Value

Type: Telerik.ReportViewer.CommonPrintBeginEventHandler

Examples

This example illustrates how to wire the PrintBegin event and how to cancel it if needed.
void reportViewer1_PrintBegin(object sender, Telerik.ReportViewer.Common.PrintBeginEventArgs e)
{
    if (true) // some logic here
    {
        // Cancel is false by default
        e.Cancel = true;
    }

    //To prevent the Print Dialog from appearing, you should specify valid printer settings to this method.
    if (true)
    {
        // Obtain the settings of the default printer
        e.PrinterSettings = new System.Drawing.Printing.PrinterSettings();

        // To suppress the Print dialogs. The standard print controller comes with no UI
        e.PrintController = new System.Drawing.Printing.StandardPrintController();
    }
}

See Also