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

QQ登录

只需一步,快速开始

查看: 3385|回复: 6

[结贴] 报表是否能用中文做为字段

[复制链接]

51

主题

225

帖子

601

积分

高级会员

Rank: 4

积分
601
QQ
发表于 2017-4-10 17:48:14 | 显示全部楼层 |阅读模式
我用的是cData,里面的字段含有中文,这样的形式是不是不能用
  1. Nested exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 58; 元素类型 "select" 必须后跟属性规范 ">" 或 "/>"。
  2.         at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
  3.         at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
  4.         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
  5.         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
  6.         at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1437)
  7.         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.seekCloseOfStartTag(XMLDocumentFragmentScannerImpl.java:1396)
  8.         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:248)
  9.         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
  10.         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
  11.         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
  12.         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
  13.         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
  14.         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
  15.         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
  16.         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
  17.         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
  18.         at org.dom4j.io.SAXReader.read(SAXReader.java:465)
  19.         at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
  20.         at Report.generateReportMapping(Report.java:386)
  21.         at Report.generateReportDoc(Report.java:334)
  22.         at Report.generateReportDefine(Report.java:311)
  23.         at Report.execute(Report.java:67)
  24.         at com.justep.ui.component.ComponentEngine.processServerTemplate(Unknown Source)
  25.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  26.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  27.         at com.justep.ui.component.ComponentEngine.execute(Unknown Source)
  28.         at com.justep.ui.WindowCompiler2.w2Middle(Unknown Source)
  29.         at com.justep.ui.WindowCompiler2.compile(Unknown Source)
  30.         at com.justep.ui.WindowServer2.compileWindow(Unknown Source)
  31.         at com.justep.ui.WindowServer2.service(Unknown Source)
  32.         at com.justep.ui.servlet.MainServlet.service(Unknown Source)
  33.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  34.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  35.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  36.         at com.justep.portal.filter.RedirectFilter.doFilter(Unknown Source)
  37.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  38.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  39.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  40.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  41.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  42.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  43.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  44.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  45.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  46.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  47.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  48.         at java.lang.Thread.run(Thread.java:745)
  49. 2017-04-10 17:41:47 Excel生成报表定义失败,文件名:D:/WZ_V3.6/model/UI2/OA/CRM/process/ComparativeReport/mainActivity.xml
  50. javax.servlet.ServletException: java.lang.RuntimeException: Excel生成报表定义失败,文件名:D:/WZ_V3.6/model/UI2/OA/CRM/process/ComparativeReport/mainActivity.xml
  51.         at com.justep.ui.servlet.MainServlet.service(Unknown Source)
  52.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  53.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  54.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  55.         at com.justep.portal.filter.RedirectFilter.doFilter(Unknown Source)
  56.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  57.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  58.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  59.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  60.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  61.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  62.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  63.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  64.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  65.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  66.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  67.         at java.lang.Thread.run(Thread.java:745)
  68. Caused by: java.lang.RuntimeException: Excel生成报表定义失败,文件名:D:/WZ_V3.6/model/UI2/OA/CRM/process/ComparativeReport/mainActivity.xml
  69.         at com.justep.report.xls.XLSTransformer.transform(Unknown Source)
  70.         at Report.generateReportDoc(Report.java:339)
  71.         at Report.generateReportDefine(Report.java:311)
  72.         at Report.execute(Report.java:67)
  73.         at com.justep.ui.component.ComponentEngine.processServerTemplate(Unknown Source)
  74.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  75.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  76.         at com.justep.ui.component.ComponentEngine.execute(Unknown Source)
  77.         at com.justep.ui.WindowCompiler2.w2Middle(Unknown Source)
  78.         at com.justep.ui.WindowCompiler2.compile(Unknown Source)
  79.         at com.justep.ui.WindowServer2.compileWindow(Unknown Source)
  80.         at com.justep.ui.WindowServer2.service(Unknown Source)
  81.         ... 17 more
  82. Caused by: java.lang.RuntimeException: Excel生成报表定义失败
  83.         at com.justep.report.xls.XLSTransformer.transform(Unknown Source)
  84.         ... 29 more
  85. Caused by: java.lang.NullPointerException
  86.         at com.justep.report.xls.XLSTransUtils.initDataSource(Unknown Source)
  87.         at com.justep.report.xls.XLSTransModel.a(Unknown Source)
  88.         at com.justep.report.xls.XLSTransModel.transform(Unknown Source)
  89.         ... 30 more
  90. 四月 10, 2017 5:41:47 下午 org.apache.catalina.core.StandardWrapperValve invoke
  91. 严重: Servlet.service() for servlet main-servlet threw exception
  92. java.lang.NullPointerException
  93.         at com.justep.report.xls.XLSTransUtils.initDataSource(Unknown Source)
  94.         at com.justep.report.xls.XLSTransModel.a(Unknown Source)
  95.         at com.justep.report.xls.XLSTransModel.transform(Unknown Source)
  96.         at com.justep.report.xls.XLSTransformer.transform(Unknown Source)
  97.         at com.justep.report.xls.XLSTransformer.transform(Unknown Source)
  98.         at Report.generateReportDoc(Report.java:339)
  99.         at Report.generateReportDefine(Report.java:311)
  100.         at Report.execute(Report.java:67)
  101.         at com.justep.ui.component.ComponentEngine.processServerTemplate(Unknown Source)
  102.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  103.         at com.justep.ui.component.ComponentEngine.parser(Unknown Source)
  104.         at com.justep.ui.component.ComponentEngine.execute(Unknown Source)
  105.         at com.justep.ui.WindowCompiler2.w2Middle(Unknown Source)
  106.         at com.justep.ui.WindowCompiler2.compile(Unknown Source)
  107.         at com.justep.ui.WindowServer2.compileWindow(Unknown Source)
  108.         at com.justep.ui.WindowServer2.service(Unknown Source)
  109.         at com.justep.ui.servlet.MainServlet.service(Unknown Source)
  110.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  111.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  112.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  113.         at com.justep.portal.filter.RedirectFilter.doFilter(Unknown Source)
  114.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  115.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  116.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  117.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  118.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  119.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  120.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  121.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  122.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  123.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  124.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  125.         at java.lang.Thread.run(Thread.java:745)
复制代码


报错的信息如下

中文.png

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-11 09:22:20 | 显示全部楼层
把report中的中文去掉就不报错了吗?
中文的没测试过,推荐不要用中文
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

51

主题

225

帖子

601

积分

高级会员

Rank: 4

积分
601
QQ
 楼主| 发表于 2017-4-11 09:40:21 | 显示全部楼层
jishuang 发表于 2017-4-11 09:22
把report中的中文去掉就不报错了吗?
中文的没测试过,推荐不要用中文

中文去掉后也会报错,不过我用另外一个X5试了下,一开始不用中文然后建了两条数据显示的没问题,但是只要换成中文就报错,而且我在把中文换成因为后报以下错误
  1. javax.servlet.ServletException: 报表服务请求失败
  2.         at ReportBrowse.doPost(ReportBrowse.java:23)
  3.         at com.justep.ui.impl.JProcessorImpl.execute(Unknown Source)
  4.         at com.justep.ui.JavaServer.runJava(Unknown Source)
  5.         at com.justep.ui.JavaServer.doJ(Unknown Source)
  6.         at com.justep.ui.JavaServer.service(Native Method)
  7.         at com.justep.ui.servlet.MainServlet.service(Unknown Source)
  8.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  9.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  10.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  11.         at com.justep.portal.filter.RedirectFilter.doFilter(Unknown Source)
  12.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  13.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  14.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  15.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  16.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  17.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  18.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  19.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  20.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  21.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  22.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  23.         at java.lang.Thread.run(Thread.java:745)
  24. Caused by: org.dom4j.DocumentException: Error on line 1 of document  : 元素内容必须由格式正确的字符数据或标记组成。 Nested exception: 元素内容必须由格式正确的字符数据或标记组成。
  25.         at org.dom4j.io.SAXReader.read(SAXReader.java:482)
  26.         at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
  27.         at com.justep.ui.system.service.report.ReportJSONHelper.procModel(Unknown Source)
  28.         at com.justep.ui.system.service.report.ReportJSONHelper.execute(Unknown Source)
  29.         at com.justep.ui.system.service.report.ReportHelper.call(Unknown Source)
  30.         at com.justep.ui.system.service.report.ReportHelper.service(Unknown Source)
  31.         at ReportBrowse.doPost(ReportBrowse.java:21)
  32.         ... 21 more
复制代码



英文报错.png
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-11 10:50:47 | 显示全部楼层
这个错误应该就是excel文件中特殊字符的问题,重新创建excel文件看看
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

51

主题

225

帖子

601

积分

高级会员

Rank: 4

积分
601
QQ
 楼主| 发表于 2017-4-11 10:59:28 | 显示全部楼层
jishuang 发表于 2017-4-11 10:50
这个错误应该就是excel文件中特殊字符的问题,重新创建excel文件看看

已经解决了,报表在读取Cdata的时候把所有字段都读进去,其他字段的命名不规范,含有数字和文字,所以才会一直报错。 请问一下,Cdata怎么过滤数据呢
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2017-4-11 11:45:02 | 显示全部楼层
cData数据怎么来的?
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

51

主题

225

帖子

601

积分

高级会员

Rank: 4

积分
601
QQ
 楼主| 发表于 2017-4-11 14:05:25 | 显示全部楼层
jishuang 发表于 2017-4-11 11:45
cData数据怎么来的?

通过调用API得来的数据,不过现在我是直接在存数据的时候就进行了筛选,请结贴吧
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-23 15:43 , Processed in 0.100037 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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