首页 > 其他分享 >Catch ReportViewer Exception

Catch ReportViewer Exception

时间:2023-11-08 12:33:32浏览次数:28  
标签:control Exception End Sub www ReportError Catch ReportViewer

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

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

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



标签:control,Exception,End,Sub,www,ReportError,Catch,ReportViewer
From: https://blog.51cto.com/emanlee/8248576

相关文章

  • jpa 查询 报错 EntityNotFoundException
    背景:使用JPA查询,串接到另外一张表时,由于没有实际在表格关系中指定外键,而是在实体类中指定外键导致关联表中的数据被删除时,JPA查询时,报错EntityNotFoundException方案:在实体类的关联属性上,添加注解,并新增自定义序列化过滤器@JsonInclude(value=JsonInclude.Include.CUSTOM,......
  • How to add an image on reportViewer (rdlc)
    OpenthereportintheDesigner.IntheToolBox,select/expandthe"ReportItems"section.Dragan"Image"field/controlontothereport.ClickontheimageandpressF4,thepropertieswindow popsup,underthegroupdatayou'llf......
  • LINUX:Error while compiling statement: FAILED: RuntimeException Cannot create sta
    问题截图 可以看到是user=root,权限不够导致 观察发现用的是root用户更改为hadoop用户,也即是可以启动hive的用户 插入成功。 ......
  • BindException、ConstraintViolationException、MethodArgumentNotValidException入参
    Springvalidation验证框架注解Springvalidation验证框架提供了大量接口入参检验注解,注意三个非空注解:@NotNull:验证对象是否不为null,无法查检长度为0的字符串@NotBlank:检查约束(字符串)是不是Null还有被Trim的长度是否大于0,只对字符串,且会去掉前后空格@NotEmpty:检查(集合)......
  • 异常详细信息: System.Web.HttpException: 服务器太忙
    HTTP双连接限制HTTP规范表明,一个HTTP客户端与任一服务器最多可以同时建立两个TCP连接。这可以防止单个浏览器在浏览某个页面(例如,具有120个嵌入的缩略图)时,由于连接请求过多而使服务器负载过重。此时,浏览器将仅创建2个连接,然后通过这两个管道开始发送120个HTTP请求,而......
  • HttpClient报错 org.apache.http.NoHttpResponseException : 10.1.1.0:13001 failed t
    一、问题描述使用HttpClient并发调用http接口,并发量稍微大一点就会报错org.apache.http.NoHttpResponseException:10.1.1.0:13001failedtorespond 二、排查过程最开始怀疑是服务端连接过多,拒绝请求了,监控发现服务端并没有多少连接找运维搭建了一个新环(只有我们请求服务端),......
  • JSch连接SSH问题Exception:Algorithm negotiation fail
    Java连接RPA系统,由于特殊原因不能使用接口,决定用openssh连接,定时读取与推送。注意点:1、C:\ProgramData\ssh\sshd_config配置2、ssh-keygen-trsa生成秘钥方式3、生成之后追加到authorized_keys编码格式utf-84、authorized_keys后缀5、com.jcraft.jsch长时间没有更新,windo......
  • java.time.format.DateTimeParseException: Text ‘202310132358‘ could not be pars
    你遇到的问题是由于在解析日期和时间时格式不正确。Java无法解析‘202310132358’这个字符串,因为它不符合Java日期时间格式。Java期望的日期时间格式通常是“yyyy-MM-ddHH:mm:ss”,其中:yyyy是四位数的年份MM是两位数的月份dd是两位数的日期HH是两位数的小时(24小时制)mm是两......
  • .Net Core AOP之IExceptionFilter
    一、简介在.netcore中Filter分为以下六大类:1、AuthorizeAttribute(权限验证)2、IResourceFilter(资源缓存)3、IActionFilter(执行方法前后的记录)4、IResultFilter(结果生成前后扩展)5、IAlwaysRun(响应结果的补充)6、IExceptionFilter(异常处理)二、使用publicclassCustomerE......
  • BigDecimal java.lang.ArithmeticException: / by zero问题
    BigDecimalbigDecimal=newBigDecimal("0.0");BigDecimalbigDecimal1=newBigDecimal(0);//一定要用compareTo去比较被除数是否为0,不能用equalsif(BigDecimal.ZERO.compareTo(bigDecimal)==0||bigDecimal==null){System.out.println("true1111");}......