ReportViewer.PrintDialog Method ()

 

Displays the Print dialog box.

Namespace:   Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Syntax

public DialogResult PrintDialog()
public:
DialogResult PrintDialog()
member PrintDialog : unit -> DialogResult
Public Function PrintDialog As DialogResult

Return Value

Type: System.Windows.Forms.DialogResult

Cancel if the user clicked the Cancel button or if the Print event is cancelled; OK if the user clicked the OK button.

Remarks

Calling this method while the report is being rendered in the control causes an InvalidOperationException to be thrown.

Examples

Legacy Code Example

private void button1_Click(object sender, EventArgs e)
{
   reportViewer.PrintDialog();
}
Private Sub Button1_Click(ByVal sender As System.Object, _
            ByVal e As System.EventArgs) Handles Button1.Click
   ReportViewer1.PrintDialog()
End Sub

See Also

PrintDialog Overload
ReportViewer Class
Microsoft.Reporting.WinForms Namespace

Return to top