Comments (4)
@RoyXiBoy 我最近在重构这部分代码,100w 行数据读取和写入的测试在 30s 左右。
该版本尚未发布,还有一些其他测试在做,测试代码
from excel-plus.
我也遇到了 ,我的做法是挪到for 后面, 重新 while 遍历一遍cols, 专门来 autoSizeColumn
for (int rowNum = startRow; iterator.hasNext(); rowNum++) {
T item = iterator.next();
Row row = sheet.createRow(rowNum);
if (null != rowStyle) {
row.setRowStyle(rowStyle);
}
Iterator<Integer> colIt = columnIndexes.iterator();
while (colIt.hasNext()) {
int col = colIt.next();
Cell cell = row.createCell(col);
String value = ExcelUtils.getColumnValue(item, col);
if (null != columnStyle) {
cell.setCellStyle(columnStyle);
}
if (null != value) {
if (ExcelUtils.isNumber(value)) {
cell.setCellValue(Double.valueOf(value));
} else {
cell.setCellValue(value);
}
} else {
cell.setCellValue(value);
}
// sheet.autoSizeColumn(col);
}
}
Iterator<Integer> colIt = columnIndexes.iterator();
while (colIt.hasNext()) {
int col = colIt.next();
sheet.autoSizeColumn(col);
}
from excel-plus.
还有一个就是使用xssfworkbook再导出2w条的时候就会oom了。建议使用sxssfworkbook装饰xssfworkbook。
from excel-plus.
该版本已发布,忘记这里的 issue 了。
from excel-plus.
Related Issues (20)
- 使用模板导出,内容写入有问题,没有填充模板而是新建sheet写入了 HOT 2
- 请问Android是否能使用 HOT 3
- 请问写入或者读取的时候,能否动态的配置Excel行?
- 【question】Reader读取Excel的时候遇到null值不处理 converter
- 【feature request】excel-plus可否添加对Map类型的读写?
- Problem with export HOT 2
- 能否在一个excel文件中写入多个sheet HOT 1
- 模版导出有什么办法能根据条件动态设置某一列某一行的字体颜色?
- Excel两百万条数据分表写入
- 导入excel报错:Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data. HOT 1
- 在导出excel时,生成大量临时文件poi-sxssf-sheet.xml HOT 1
- Export multi sheet
- sheet多个写入 HOT 2
- 希望增加对Android的支持,感谢~
- 可以增加一个关于设置配色的使用例子吗?
- 同样出现设置模板并没有填充模板的sheet表,而又重新创建的sheet0,使用sheet指定后报错(sheet名字重复)
- 如何获取xls中多个sheet的名字
- 文档地址挂了 HOT 1
- Cause by CVE-2019-12415-Apache-POI,suggest to upgrade poi to 4.1.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from excel-plus.