java excel poi 怎么导入

java excel poi 怎么导入,第1张

1、下载poi相关jar,maven的集成如下:(把${poiversion}替换成你要的版本)

 <dependency>
            <groupId>orgapachepoi</groupId>
            <artifactId>poi</artifactId>
            <version>${poiversion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>orgapachepoi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${poiversion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>orgapachepoi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>${poiversion}</version>
            <scope>provided</scope>
        </dependency>

2、根据poi相关api读取sheet、row、cell,获得excel的数据

封装row的对象,即每一行数据为一个对象,每个cell为对象里的一个属性,

整个sheet的数据装进集合里;

3、处理数据,可以对数据进行验证或其他 *** 作;

4、写数据库 *** 作。

两种方式:1)将你的网页报表用poi或jxl,转化为excel格式,然后通过servlet的流输出 2)使用现有的报表工具实现,我用finereport,其他的你也可以去Google搜下。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/13411443.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-31
下一篇 2023-07-31

发表评论

登录后才能评论

评论列表(0条)

保存