group 分组报表空指针
在使用 group 制作分组报表时报错
java.lang.NullPointerException
at com.raqsoft.report.model.engine.SimplePager.createPages(Unknown Source:182)
at com.raqsoft.report.usermodel.PageBuilder.$2(Unknown Source:407)
at com.raqsoft.report.usermodel.PageBuilder.$3(Unknown Source:352)
at com.raqsoft.report.usermodel.PageBuilder.createPages(Unknown Source:322)
at com.raqsoft.report.cache.llllIlIllIllIlll.getPageBuilder(Unknown Source:29)
at com.raqsoft.report.cache.PagerCache.getPageBuilder(Unknown Source:107)
at com.raqsoft.report.cache.llllIlIllIllIlll.getPageCount(Unknown Source:59)
at com.raqsoft.report.tag.HtmlTag.doStartTag(Unknown Source:374)
at org.apache.jsp.reportJsp.showReport_jsp._jspService(showReport_jsp.java:305)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.raqsoft.report.webutil.CharacterEncodingFilter.doFilter(Unknown Source:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)
看报错信息是和分页相关,可以在这方面排查下,或者更改下数据是否有问题。
如果不好确定问题,看下是否能将报表数据集转成内建,然后把报表发上来看下。
数据集转内建方法,报表设计器下,数据集,选中数据集,点右侧转为内建,如果有参数时会让输入对应数据的参数,然后确定保存。
把报表发下,然后 看下 showReport.jsp 中的 tag 标签(report:html 那段)是怎么配置的,也发下看看
我把分页部分去掉试了一下也没有效果,我觉得应该是分组过程中的分页问题。
我将报表文件放到了下述压缩包中,以及 showReport.jsp 中您指定那段的代码截图,麻烦解答下
report7z
这个主要是加了表头和表尾后,然后在加分组并设置左主格时,导致分页出现的问题,可以这么改下:
将前 5 行的报表头,改成分组表头,并且右侧属性栏的行属性那块有个表头级别,前两行级别 1,第三行级别 2,第 4 行级别 3,依次类推,这样报表分组后,里边的数据能根据组内的数据变化
然后将报表尾那几行的左主格去掉
可以看下附件。
reportzip
不过这个可能有个问题,报表尾内的数据就都一样了,你这个分了三页,三页报表尾的内容一样了。
如果将来报表尾和报表头要求每页都变化,那么可能就没法用报表里的报表头和报表尾了,需要在报表里特殊制作下,类似这个了: 分组报表——报表分组统计增加组内页码及补空行