关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 16415|回复: 8

excel导入模板

[复制链接]
发表于 2013-5-14 20:53:05 | 显示全部楼层 |阅读模式
excel导入模板 用户信息.xls (4 KB, 下载次数: 9503)


发表于 2013-5-14 21:27:52 | 显示全部楼层
还是不行啊!
aaa.JPG
发表于 2013-5-14 21:32:14 | 显示全部楼层
cian 发表于 2013-5-14 21:27
还是不行啊!

后台错误堆栈贴来看看
 楼主| 发表于 2013-5-14 21:51:39 | 显示全部楼层
GIN 发表于 2013-5-14 21:32
后台错误堆栈贴来看看

我看看这两天先发一个bata版本吧,这个版本的导入导出例子做了更好的测试
发表于 2013-5-14 21:53:52 | 显示全部楼层
GIN 发表于 2013-5-14 21:32
后台错误堆栈贴来看看

java.lang.IllegalStateException: Cannot get a numeric value from a text cell
        at org.apache.poi.hssf.usermodel.HSSFCell.typeMismatch(HSSFCell.java:637
)
        at org.apache.poi.hssf.usermodel.HSSFCell.getNumericCellValue(HSSFCell.j
ava:662)
        at org.jeecgframework.core.util.excel.ExcelUtil.importExcelByIs(ExcelUti
l.java:821)
        at jeecg.demo.controller.test.JpPersonController.implXls(JpPersonControl
ler.java:140)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.
invokeHandlerMethod(HandlerMethodInvoker.java:176)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:923)
        at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:852)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:882)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
let.java:789)
        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(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.j
ava:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:70)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
al(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.do
FilterInternal(OpenSessionInViewFilter.java:119)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
r.java:879)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:617)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:17
60)
        at java.lang.Thread.run(Thread.java:722)
[org.jeecgframework.core.common.exception.MyExceptionHandler]java.lang.NullPoint
erException
        at jeecg.demo.controller.test.JpPersonController.implXls(JpPersonControl
ler.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.
invokeHandlerMethod(HandlerMethodInvoker.java:176)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:923)
        at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:852)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:882)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
let.java:789)
        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(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.j
ava:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:70)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
al(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.do
FilterInternal(OpenSessionInViewFilter.java:119)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
r.java:879)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:617)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:17
60)
        at java.lang.Thread.run(Thread.java:722)

发表于 2013-5-14 22:00:10 | 显示全部楼层
cian 发表于 2013-5-14 21:53
java.lang.IllegalStateException: Cannot get a numeric value from a text cell
        at org.apache ...

jeecg_scott 有心了,也不要急,慢慢来!!!只是我这人代码跑不通就抓狂!!!同事都说我没救了
发表于 2013-5-22 11:31:08 | 显示全部楼层
本帖最后由 niaolianyu 于 2013-5-22 11:46 编辑

scott提供的模板 里面全为文本格式
所以导入有问题
另外 有个地方加一行
else if (xclass.equals("class java.lang.Integer"))
{
// 先设置Cell的类型,然后就可以把纯数字作为String类型读进来了:
cell.setCellType(Cell.CELL_TYPE_STRING);
setMethod.invoke(tObject, new Integer(cell.getStringCellValue()));
}

里面的格式用正常格式 日期用日期格式
下面的日期格式没带 时间信息倒入是没有问题的
带时间信息的可以自己测试
修改上面的后
导入没有问题
正式的等scott的正式版吧

用下面的倒入
用户信息 (1).zip (1.85 KB, 下载次数: 8668)

发表于 2013-5-23 13:25:08 | 显示全部楼层
我也是这样改的,框架里的好些功能都不完整,比如上传下载等,需要自己动手完善起来...
发表于 2013-12-11 10:24:12 | 显示全部楼层
我按照说明做了一个excel的导入demo,我要导入的excel中有6条数据,导入的时候生成的list的size也是6,但是list中每个对象的每个属性都是null这是为什么?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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