简体   繁体   English

从Java写入Excel需要大量记录

[英]Writing to Excel from Java takes long time for large number of records

I am using Jxl API to write to Excel,to export large number of records to excel. 我正在使用Jxl API写入Excel,以将大量记录导出到excel。 For my configuration number of records are around 40000. and for before writing these records i have to do lots of computation on fly. 对于我的配置,记录数约为40000。对于写入这些记录,我必须即时进行大量计算。 there are 16 columns and for 9 columns i am forced to do computation on fly. 有16列,对于9列,我被迫进行实时计算。 In a minute it's writing only 2 records to excel, with this speed it is not feasible to write whole data to excel. 在一分钟之内,它只向Excel写入2条记录,以这种速度将全部数据写入excel是不可行的。 because with this speed it will take around 12-15 days to complete the process that is not at all acceptable ,can some one suggest any other way i can proceed to finish whole process in 1-2 hours ....!! 因为以这种速度,大约需要12-15天才能完成完全不可接受的过程,可以有人建议我以其他方式在1-2个小时内完成整个过程吗? thanks in advance !! 提前致谢 !!

some more info --- 一些更多信息-

for some columns i am picking the data from db table and adding to sheetData and for other columns for which i am doing computations on fly i am picking data from some db table and calculating the data based on updated input which i got from db tables. 对于某些列,我从数据库表中选取数据并添加到sheetData中;对于其他列,我正在对其进行实时计算的我从某些数据库表中选取数据,并根据我从数据库表中获得的更新输入来计算数据。 for every row and every column input is taking from db tables. 对于每一行,每一列的输入都取自数据库表。

It is fairly difficult to predict the cause of this delay. 很难预测这种延迟的原因。 I would prepare the data first and then time the export processing, in order to get a clear view of the required time for this specific activity . 我将首先准备数据,然后安排导出处理的时间,以便清楚地了解此特定活动所需的时间。

xls generation takes its time, but 2 records a minute sounds like an overkill. xls生成花费时间,但是2分钟记录听起来有点过分。 You could also try to generate your xls with iReport . 您也可以尝试使用iReport生成xls。 Make a single sheet spreadsheet. 制作一张工作表电子表格。 iReport is quite quick. iReport非常快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM