You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by nitinK <ni...@gmail.com> on 2014/11/14 08:30:57 UTC

XSSFWorkbook/SXSSFWorkbook.. takes to much time to generate .xlsx..

Hi,
I am trying to generate .xlsx file using poi-3.9 API and tried with
SXSSFWorkbook/XSSFWorkbook.
I have an .xlsx template file having 4 sheets with pia charts and 2 sheets
with raw data and formatted data.

I have 64000 records with 13 columns and it is taking 25-30 minutes to
generate...can anyone please help me..I have to complete my performance
testing...

Thanks in advance...



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSSFWorkbook-SXSSFWorkbook-takes-to-much-time-to-generate-xlsx-tp5717171.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSSFWorkbook/SXSSFWorkbook.. takes to much time to generate .xlsx..

Posted by nitinK <ni...@gmail.com>.
Hi Nick ,
Thanks for your quick reply...but we have added some Font
,CellStyle,Hyperlinks ,Pei Charts ,So can you please share your views on
this..does it hamper performance..?

Let me explain our approach to you..We are taking data from server and we
have an .xlsx template file in which we have defined some templates.so we
pick this template and write data to this template using poi API like create
row,cell.setCellValue(..)etc.It is not taking much time.but when we write
this to output stream using Workbook.write(out); it is taking around 20-30
minutes.

			//Get the workbook instance for XLS file
		  String templateFile=	"C:/home/filled_title_reports.xlsx";
			XSSFWorkbook workbook= new XSSFWorkbook(templateFile);
			
			workbook.setActiveSheet(0);
			
			System.out.println(" update workbook start : "+new Date());
			
			updateWorkBook(workbook, dataMatrix);				
			
			System.out.println(" update workbook end : "+new Date());
			
			FileOutputStream out = new FileOutputStream(new File("c:/home",
sessionID+".xlsx"));
			
			System.out.println(" write workbook start : "+new Date());
		    
			workbook.write(out);  //This line is taking tooooo much time...
		    
		       System.out.println(" write workbook end : "+new Date());
		    out.close();	

Can you please share your thoughts.




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSSFWorkbook-SXSSFWorkbook-takes-to-much-time-to-generate-xlsx-tp5717171p5717173.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSSFWorkbook/SXSSFWorkbook.. takes to much time to generate .xlsx..

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 14 Nov 2014, nitinK wrote:
> I have 64000 records with 13 columns and it is taking 25-30 minutes to 
> generate...can anyone please help me..I have to complete my performance 
> testing...

See the FAQ for advice - http://poi.apache.org/faq.html#faq-N10109 - the 
problem is most likely in your code for fetching Data. Writing a 64k row, 
13 column file with XSSF takes 15 seconds on my laptop (HSSF and SXSSF 
were both 3 seconds). Any problem would therefore seem to be with your 
code, not POI!

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org