Problem:

 I would like to know how I can catch errors that showup on my reportviewer web server control when for instance there is a parameter whose value was not set.

Solution:

You can you the ReportError method of the ReportViewer control. It has an 'e' argument of type ReportErrorEventArgs, which you can use to handle the error.

For example, I have a page where I use it like this:

Protected Sub ReportViewer1_ReportError(ByVal sender As Object, ByVal e As Microsoft.Reporting.WebForms.ReportErrorEventArgs) Handles ReportViewer1.ReportError 
If TypeOf e.Exception Is AspNetSessionExpiredException Then
e.Handled = True
Session.Abandon()
FormsAuthentication.SignOut()
Response.Redirect(FormsAuthentication.LoginUrl, True)
Else
e.Handled = False
End If
End Sub


from:

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23871497.html

http://www.codeprof.com/dev-archive/90/6-75-908431.shtm

相关文章:

  • 2021-12-24
  • 2021-09-19
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-31
  • 2021-09-18
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
相关资源
相似解决方案