Thanks for your reply and help.
I was able to do it as:
<cffile action="COPY" source="#filepathtemplate#"
destination="#filepath#">
<cfset writeableWorkbook =
createObject("java","org.apache.poi.xssf.streaming.SXSSFWorkbook").init(1000)
/>
<cfset cellStyleStatic =
createObject("java","org.apache.poi.xssf.usermodel.XSSFCellStyle") />
<cfset region =
createObject("java","org.apache.poi.ss.util.CellRangeAddress") />
<cfset moneyFormat = writeableWorkbook.createDataFormat() />
<cfset moneyStyle = writeableWorkbook.createCellStyle() />
<cfset
moneyStyle.setDataFormat(moneyFormat.getFormat("$##,####0.00_);[Red]($##,####0.00)"))
/>
<cfset colorLib =
createObject("java","org.apache.poi.ss.usermodel.IndexedColors") />
<cfset fcBlack = colorLib.BLACK.getIndex() />
<cfset fcYellow = colorLib.YELLOW.getIndex() />
<cfset fcRed = colorLib.RED.getIndex() />
<cfset fcPink = colorLib.PINK.getIndex() />
<cfset fcCyan = colorLib.TURQUOISE.getIndex() />
<cfset fcTan = colorLib.TAN.getIndex() />
<cfset fcGrey = colorLib.GREY_25_PERCENT.getIndex() />
<cfset percentStyleBlack = writeableWorkbook.createCellStyle() />
<cfset percentStyleBlack.setAlignment(cellStyleStatic.ALIGN_CENTER)>
<cfset
percentStyleBlack.setFillPattern(percentStyleBlack.SOLID_FOREGROUND) />
<cfset percentStyleBlack.setFillForegroundColor(fcBlack) />
GET DATA AND CREATE SHEETS, ROWS, CELLS .....
<cfset writeableWorkbook.setActiveSheet(0) />
<cfset xlsFile =
createObject("java","java.io.FileOutputStream").init(filepath) />
<cfset writeableWorkbook.write(xlsFile) />
<cfset writeableWorkbook.dispose() />
<cfset xlsFile.close() />
Now my issue is that the file is taking little over 2 mins to write aprox
90K rows in the browser. For some people get browser time out because they
have slow connection.
I was able to improved the speed before with java setting in CF as
https://forums.adobe.com/thread/1476097
anyone here deals with a lot of rows? What is a good time performance for
write the aprox 90K rows?
Am i missing something in my code?
Thanks
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Create-an-excel-file-using-template-tp5717313p5717326.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]