简体   繁体   中英

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. For my configuration number of records are around 40000. and for before writing these records i have to do lots of computation on fly. there are 16 columns and for 9 columns i am forced to do computation on fly. In a minute it's writing only 2 records to excel, with this speed it is not feasible to write whole data to 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 ....!! 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. 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. You could also try to generate your xls with iReport . Make a single sheet spreadsheet. iReport is quite quick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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