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

QQ登录

只需一步,快速开始

查看: 4794|回复: 11

[结贴] 主页面给报表传参

[复制链接]

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
发表于 2017-4-20 11:29:37 | 显示全部楼层 |阅读模式
有一个问题请教:主页面通过grid选多行,如何将多行数据作为结果传递给报表?

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-20 13:17:27 | 显示全部楼层
页面之间交互传参参考http://docs.wex5.com/page-interaction/
报表参数查询参考/UI2/demo/report/process/property/parameterFilterReport.w
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-21 10:48:11 | 显示全部楼层
帮我看下,以下代码拼select语句有什么毛病              

String mssql = "SELECT * FROM sfc310";
                String id = (String) ids.iterator().next();
                mssql += "WHERE id='"+ id +"' ";
                ids.iterator().remove();
                while (ids.iterator().hasNext()) {
                                 //id = (String) ids.iterator().next();
                        mssql += "OR id='"+ id +"' ";
回复 支持 反对

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-21 10:52:14 | 显示全部楼层
jishuang 发表于 2017-4-20 13:17
页面之间交互传参参考http://docs.wex5.com/page-interaction/
报表参数查询参考/UI2/demo/report/process/ ...


帮我看下,以下代码拼select语句有什么毛病 ,现在参数能传到reportaction,但还是报错数据未取到
            

String mssql = "SELECT * FROM sfc310";
String id = (String) ids.iterator().next();
mssql += "WHERE id='"+ id +"' ";
ids.iterator().remove();
while (ids.iterator().hasNext()) {
                                
    mssql += "OR id='"+ id +"' ";
}
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-21 13:47:56 | 显示全部楼层
具体的报错信息发一下
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-21 16:03:13 | 显示全部楼层
jishuang 发表于 2017-4-21 13:47
具体的报错信息发一下

[FC20170421003   , FC20170421002   , FC20170421001   ]2017-04-21 15:59:51 excute stream action, params:{"accept":"application/json","action":"jj","actionFlag":"__action_0__","activity":"staticActivity6","contentType":"json","executeContext":"","executor":"","parameters":{"ids":["FC20170421003   ","FC20170421002   ","FC20170421001   "]},"process":"/erp/cggl/process/cggl/cgglProcess"}
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        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: java.lang.IllegalStateException
        at java.util.ArrayList$Itr.remove(ArrayList.java:864)
        at Cggl.jj(Cggl.java:149)
        ... 27 more
null2017-04-21 15:59:52 action:<?xml version="1.0" encoding="UTF-8"?>
<action process="/erp/cggl/process/cggl/cgglProcess" activity="staticActivity6" action-flag="__action_0__" executor="" execute-context="" name="jj"><parameters xmlns:xbiz="http://www.justep.com/xbiz#"></parameters></action>
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        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: java.lang.NullPointerException
        at Cggl.jj(Cggl.java:145)
        ... 27 more
[ERROR] 2017-04-21 15:59:52,555 com.justep.report.controller.DataController - 报表数据获取失败
null
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: null
        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
回复 支持 反对

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-21 16:05:10 | 显示全部楼层
public static Table jj(List<?> ids){
                System.out.print(ids);
                String mssql = "SELECT * FROM sfc310";
                String id = (String) ids.iterator().next();
               
               
                mssql += "WHERE id='"+ id +"' ";
                ids.iterator().remove();
                while (ids.iterator().hasNext()) {
                               
                        mssql += "OR id='"+ id +"' ";
                       
            }      
               
                System.out.print(mssql);
               
                HashMap<String,String> sqlMap = new HashMap<String,String>();
                sqlMap.put(SQL.DEFAULT_DB_NAME,mssql);
               
                sqlMap.put(DatabaseProduct.MSSQL.name(),mssql);
               
                return SQL.select(sqlMap,null,"/erp/cggl/data");
        }
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-21 16:31:39 | 显示全部楼层
java.lang.NullPointerException
        at Cggl.jj(Cggl.java:145)

java代码调试跟踪一下报空指针了
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-22 16:16:38 | 显示全部楼层
查询语句拼接成功,语句在数据库运行可以取到数据,但报表仍报错如下:
SELECT * FROM sfc310  WHERE id = 'FC20170422003   '  or id = 'FC20170422004   '  or id = 'FC20170422002   ' 2017-04-22 16:09:10 加载模块:/UI2/system/service/report ...
2017-04-22 16:09:10 加载模块:/UI2/system/service/report
2017-04-22 16:09:11 action:<?xml version="1.0" encoding="UTF-8"?>
<action process="/erp/cggl/process/cggl/cgglProcess" activity="staticActivity6" action-flag="__action_0__" executor="" execute-context="" name="jj"><parameters xmlns:xbiz="http://www.justep.com/xbiz#"></parameters></action>
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        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: java.lang.NullPointerException
        at Cggl.jj(Cggl.java:143)
        ... 27 more
[ERROR] 2017-04-22 16:09:11,454 com.justep.report.controller.DataController - 报表数据获取失败
null
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: null
        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
回复 支持 反对

使用道具 举报

16

主题

71

帖子

227

积分

中级会员

Rank: 3Rank: 3

积分
227
QQ
 楼主| 发表于 2017-4-22 16:38:50 | 显示全部楼层
public static Table jj(Map<?, ?> sql,String dataModel,List<String> ids){
                System.out.print(ids.size());
                System.out.print(ids.get(0));
                String mssql = " SELECT * FROM sfc310 ";
               
                int i=0;
                for (i=0;i<ids.size();i++){
                        String id = ids.get(i);
                        if(i<1){
                                mssql += " WHERE id = '" + id + "' ";
                        }else{
                                mssql += " or id = '" + id + "' ";
                        }
                       
                }
                               
                System.out.print(mssql);
               
                HashMap<String,String> sqlMap = new HashMap<String,String>();
                sqlMap.put(SQL.DEFAULT_DB_NAME,mssql);
               
                //sqlMap.put(DatabaseProduct.MSSQL.name(),mssql);
               
               
                return SQL.select(sqlMap,null,"/erp/cggl/data");
        }
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 21:15 , Processed in 0.056810 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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