Share via


ReportViewer.PrintingBegin 事件

發生於如果使用者按一下 [列印] 對話方塊中的 [列印] 按鈕。

命名空間:  Microsoft.Reporting.WinForms
組件:  Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)

語法

'宣告
Public Event PrintingBegin As ReportPrintEventHandler
'用途
Dim instance As ReportViewer
Dim handler As ReportPrintEventHandler

AddHandler instance.PrintingBegin, handler
public event ReportPrintEventHandler PrintingBegin
public:
 event ReportPrintEventHandler^ PrintingBegin {
    void add (ReportPrintEventHandler^ value);
    void remove (ReportPrintEventHandler^ value);
}
member PrintingBegin : IEvent<ReportPrintEventHandler,
    ReportPrintEventArgs>
JScript 支援使用事件,但不支援新的宣告。

備註

當 [列印] 對話方塊是由 PrintDialog 方法啟動或由使用者按一下工具列上的 [列印] 按鈕啟動時,就會發生這個事件。這個事件的相關資訊會在 ReportPrintEventArgs 物件中傳遞至 ReportPrintEventHandler 委派,由它來處理事件。

事件引數包含使用者在 [列印] 對話方塊中選取的印表機設定。如果這個事件未取消,印表機設定會儲存至 PrinterSettings 屬性。如果這個事件已取消,便不會顯示 [列印] 對話方塊,不會列印報表,也不會儲存印表機設定。

如需處理事件的詳細資訊,請參閱Consuming Events

請參閱

參考

ReportViewer 類別

Microsoft.Reporting.WinForms 命名空間