Fight With Me!!!

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

随笔分类 -  Poi

poi大数据导入解决方法
摘要:This one comes up quite a lot, but often the reason isn't what you might initially think. So, the first thing to check is - what's the source of the p 阅读全文

posted @ 2016-03-03 15:59 nickTimer 编辑

基于SXSSF (Streaming Usermodel API)的写文件
摘要:在POI3.8中SXSSF仅仅支持excel2007格式是对XSSF的一种流的扩展。目的在生成excel时候,需要生成大量的数据的时候,通过刷新的方式将excel内存信息刷新到硬盘的方式,提供写入数据的效率。 官方原文如下: SXSSF (Streaming Usermodel API) Note 阅读全文

posted @ 2016-03-03 14:21 nickTimer 编辑

POI导出数据内存溢出问题
摘要:POI之前的版本不支持大数据量处理,如果数据过多则经常报OOM错误,有时候调整JVM大小效果也不是太好。3.8版本的POI新出来了SXSSFWorkbook,可以支持大数据量的操作,只是SXSSFWorkbook只支持.xlsx格式,不支持.xls格式。 3.8版本的POI对excel的导出操作,一 阅读全文

posted @ 2016-03-03 14:20 nickTimer 编辑

如何把Excel另存为XML格式文件(快速转换)
摘要:这时,我们尝试另存为另一种文件类型:XML电子表格2003(*.xml) 阅读全文

posted @ 2015-09-10 18:25 nickTimer 编辑

JXL读取Excel日期时间不准确
摘要:XL读取Excel日期时间多出了8个小时。 Cell c = rs.getCell(j, i); if (c.getType() == CellType.DATE) {//手动填写模板文件时为 date 类型,其他情况有可能不是date类型 DateCell dc = (D... 阅读全文

posted @ 2015-09-09 18:56 nickTimer 编辑

POI使用cell.getCellStyle()设置指定单元格颜色,但是其它没有指定的单元格也会变色
摘要:HSSFCell cell = row.createCell((short)i); cell.getCellStyle().setAlignment(HSSFCellStyle.ALIGN_RIGHT);....你可能发现创建后的excel文件所有的列都变成右对齐了... 翻了翻代码,还... 阅读全文

posted @ 2015-09-08 14:59 nickTimer 编辑

JXL获取excel批注
摘要:/** * Jxl.jar(2.6.12) * @author lmiky * @date 2011-11-26 */ public class JxlTest { /** * 测试获取批注 * @author lmiky * @date 2011-11-26 * @param filePath * @throws IOExce... 阅读全文

posted @ 2015-09-07 18:30 nickTimer 编辑

POI 中Cell的backgroundcolor和foregroundcolor
摘要:刚开始以为要获得cell的背景色是使用 getFillBackgroundColor()这个函数(这里返回的是调色板的索引,要获得RGB需要先获得系统的Pallete,然后在获得 RGB)。结果出来的索引都是一样的,搜索了好一会,发现都没有自己要的答案,想想自己估计又犯了什么低级错误了,这个问题应该 阅读全文

posted @ 2015-08-04 18:29 nickTimer 编辑

POI根据EXCEL模板,修改内容导出新EXCEL (只支持HSSF)
摘要:模板风格不变,只是修改内容,生成新EXCEL,原模板不变 阅读全文

posted @ 2015-08-04 18:28 nickTimer 编辑

Can't obtain the input stream from /docProps/app.xml
摘要:今天在做poi修改样式时,报了以下错误: 网上查了相关文档,没找到相关资料,也没有给出解决资料,绝望之余,网上查找了poi修改数据的代码,运行了下竟然可以通过,以下为代码: 我的错误代码如下: 简单比较以下差异处在XSSFWorkbook初始化的时候: 错误的描述是无法获得输入流: can not 阅读全文

posted @ 2015-08-04 18:19 nickTimer 编辑

【JAVA】别特注意,POI中getLastRowNum() 和getLastCellNum()的区别
摘要:hssfSheet.getLastRowNum();.行标,比行数小1 hssfSheet.getRow(k).getLastCellNum();//获取列数,比最后一列列标大1 行标.列标都以0开始。 hssfSheet.getLastRowNum();.行标,比行数小1 hssfSheet.ge 阅读全文

posted @ 2015-08-03 15:53 nickTimer 编辑

poi对wps excel的支持
摘要:今天在使用poi解析xls文件的时候出现了如下异常 Exception in thread"main"java.lang.RuntimeException: Expected an EXTERNSHEET record but got (org.apache.poi.hssf.record.SSTR... 阅读全文

posted @ 2015-07-15 15:47 nickTimer 编辑

点击右上角即可分享
微信分享提示