导出excel数据超出了100万条怎么解决

导出excel数据超出了100万条怎么解决,第1张

数据量太大导出来作用也不大哦。已经失去用EXCEL来处理的意义了,即使导下来了,随便输入一个函数,作一下 *** 作,都要卡半天,
对于大量数据推荐用SQL 来 *** 作,安装一下数据库,也是可以做各种的数据分析。

最佳答案: 如果数据不是EXCEL类型,可以先在记事本打开,然后保存---在EXCEL打开记事本---数据就会去到EXCEL的最后一行,复制最后一行资料到记事本那里查找看已经复制到哪

你这问题太大了
HSSFWorkbook 是导出excel的工具,可是实现导出excel控制条数
//开始打印
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet=wbcreateSheet("sheet1");
HSSFRow row = sheetcreateRow(0);
//设置第一行标题
HSSFCell cell;
JobColumn jobColumn = null;
int colsAddSize = NewmasterstudentActionCOLS4EXPORT_CODElength;
for(int i=0 ; i<colsAddSize ; i++){
cell = rowcreateCell((short)i);
cellsetCellValue(NewmasterstudentActionCOLS4EXPORT_CODE[i]+"("+NewmasterstudentActionCOLS4EXPORT_NAME[i]+")");
}
for(int i=0;i<jobListsize();i++){
UserJobColumn userJob = jobListget(i);
jobColumn = userJobgetJobColumn();
cell = rowcreateCell((short)(i+colsAddSize));
cellsetCellValue(jobColumngetColumnCode()+"("+jobColumngetColumnName()+")"); //字段代码
}
//打印记录
Set<Entry<String,List<JobRecord>>> entrySet = desentrySet();
Iterator<Entry<String, List<JobRecord>>> it = entrySetiterator();
int index = 1;
while(ithasNext()){
Entry<String, List<JobRecord>> en = itnext();
row = sheetcreateRow(index++);
String xh = engetKey();
//打印学生信息
cell = rowcreateCell((short)0);
cellsetCellValue(xh);
NewMasterStudent stu = studentMapget(xh);
if(stu != null){
cell = rowcreateCell((short)1);
cellsetCellValue(stugetYbd() "是" : "否");
cell = rowcreateCell((short)2);
cellsetCellValue(stugetRemark() == null "" : stugetRemark());
}
//打印记录
List<JobRecord> records = engetValue();
for(int i=0 ; i <jobListsize() ; i++){
cell = rowcreateCell((short)(i+colsAddSize));
UserJobColumn g = jobListget(i);
JobRecord record = null;
if(i < recordssize()){
record = recordsget(i);
if(!ggetJobColumn()getId()equals(recordgetJobColumn()getId())){
record = new JobRecord();
recordsetJobColumn(ggetJobColumn());
recordsadd(i, record);
}
}else{
record = new JobRecord();
recordsetJobColumn(ggetJobColumn());
recordsadd(i, record);
}

if(ConstantNS_JOBCOLUMN_TYPE_INPUTequals(recordgetJobColumn()getColumnType())){
cellsetCellValue(recordgetEditLr());
}else if(ConstantNS_JOBCOLUMN_TYPE_SELECTequals(recordgetJobColumn()getColumnType())){
cellsetCellValue(recordisEditState() "是":"否");
}else if(ConstantNS_JOBCOLUMN_TYPE_OPTIONequals(recordgetJobColumn()getColumnType())){
SyGeneralCode select = recordgetSelectedValue();
if(select != null){
cellsetCellValue(selectgetCode()+" | "+selectgetCnName());
}
}
}
}
ZipEntry 可以实现导出zip文件
if (files[i]exists() && !files[i]isDirectory()) {
String zjhmImg = files[i]getName();
if (zjhmMapget(zjhmImg) != null) {
num++;
FileInputStream fi = new FileInputStream(files[i]);
origin = new BufferedInputStream(fi, BUFFER);
ZipEntry entry = new ZipEntry(files[i]getName());
outputNextEntry(entry);
int count;
while ((count = originread(data, 0, BUFFER)) != -1) {
outwrite(data, 0, count);
}
outsetEncoding("GBK");
originclose();


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

原文地址: http://outofmemory.cn/yw/13398427.html

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

发表评论

登录后才能评论

评论列表(0条)

保存