起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4101|回复: 1

[处理中3] MSSQL数据库不能运行这个报表吗?

[复制链接]

171

主题

481

帖子

2394

积分

金牌会员

Rank: 6Rank: 6

积分
2394
QQ
发表于 2021-8-18 11:55:58 | 显示全部楼层 |阅读模式
使用MSSQL数据查询任务相关报表时,提示错误信息。


请问下MSSQL的数据库,需要修改程序代码吗?
执行sql:  SELECT (@i:=@i+1) NONUM,P.INSTANCENAME,P.SPROCESSNAME,P.SSTATUSNAME, DATE_FORMAT(P.sActualStartTime,'%Y-%m-%d %H:%i:%s') SACTUALSTARTTIME,DATE_FORMAT(P.ActualFinishTime,'%Y-%m-%d %H:%i:%s') SACTUALFINISHTIME, TIMESTAMPDIFF(MINUTE,P.sActualStartTime, P.ActualFinishTime) SECONDSTIME, CONCAT(TIMESTAMPDIFF(DAY, P.sActualStartTime, P.ActualFinishTime),'天', MOD(TIMESTAMPDIFF(HOUR,P.sActualStartTime, P.ActualFinishTime), 24),'小时',  MOD(TIMESTAMPDIFF(MINUTE,P.sActualStartTime, P.ActualFinishTime), 60),'分钟', MOD(TIMESTAMPDIFF(SECOND,P.sActualStartTime, P.ActualFinishTime), 60),'秒') LONGTIME FROM (SELECT S.sname INSTANCENAME,S.SPROCESS,S.SPROCESSNAME, S.sStatusNAME SSTATUSNAME, S.sActualStartTime, (CASE WHEN S.sActualFinishTime IS NOT NULL  THEN S.sActualFinishTime ELSE NOW() END) ActualFinishTime FROM SA_TASK S WHERE S.sKindID = 'tkProcessInstance' )P,(select @i:=0)B WHERE 1=1 ORDER BY SECONDSTIME desc, binds: []出错
com.justep.report.exception.ReportServerException: 报表数据获取失败
        at com.justep.report.controller.DataController.execute(Unknown Source)
        at com.justep.report.controller.GenericControllerChain.execute(Unknown Source)
        at com.justep.report.controller.InitController.execute(Unknown Source)
        at com.justep.report.controller.GenericControllerChain.execute(Unknown Source)
        at com.justep.report.Servlet.a(Unknown Source)
        at com.justep.report.Servlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.report.exception.ReportServerException: 执行sql:  SELECT (@i:=@i+1) NONUM,P.INSTANCENAME,P.SPROCESSNAME,P.SSTATUSNAME, DATE_FORMAT(P.sActualStartTime,'%Y-%m-%d %H:%i:%s') SACTUALSTARTTIME,DATE_FORMAT(P.ActualFinishTime,'%Y-%m-%d %H:%i:%s') SACTUALFINISHTIME, TIMESTAMPDIFF(MINUTE,P.sActualStartTime, P.ActualFinishTime) SECONDSTIME, CONCAT(TIMESTAMPDIFF(DAY, P.sActualStartTime, P.ActualFinishTime),'天', MOD(TIMESTAMPDIFF(HOUR,P.sActualStartTime, P.ActualFinishTime), 24),'小时',  MOD(TIMESTAMPDIFF(MINUTE,P.sActualStartTime, P.ActualFinishTime), 60),'分钟', MOD(TIMESTAMPDIFF(SECOND,P.sActualStartTime, P.ActualFinishTime), 60),'秒') LONGTIME FROM (SELECT S.sname INSTANCENAME,S.SPROCESS,S.SPROCESSNAME, S.sStatusNAME SSTATUSNAME, S.sActualStartTime, (CASE WHEN S.sActualFinishTime IS NOT NULL  THEN S.sActualFinishTime ELSE NOW() END) ActualFinishTime FROM SA_TASK S WHERE S.sKindID = 'tkProcessInstance' )P,(select @i:=0)B WHERE 1=1 ORDER BY SECONDSTIME desc, binds: []出错
        at com.justep.report.controller.DataController.a(Unknown Source)
        at com.justep.report.controller.DataController.a(Unknown Source)
        ... 20 more
Caused by: java.lang.Exception
        ... 22 more

截图.png

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2021-8-19 09:59:28 | 显示全部楼层
sql到数据库中执行看是否可以,mssql数据库就需要用msssql的语法
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-23 23:10 , Processed in 0.092572 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表