There has been considerable improvements in spreadsheet performance. We have done alot of internal code changes to improve this performance. Apart from internal changes we have also exposed something for users.
SpreadSheetWrite method and write action of cfspreadsheet tag now takes one more parameter ‘autosize’.
By default now all the excel sheets have all their columns expanded and resized once they are written. Column expansion is a very expensive process which if avoided can save some valuable milliseconds.
Here is the syntax :
SpreadSheetWrite( ExcelInfo info, String filename, String password, boolean overWrite,Object autosize )
Autosize can be a boolean or an array
–> If it is boolean, true means expand/resize all the columns and false means do not expand/resize any column.
SpreadSheetWrite( info,filename,password, true,false )
–> If it is an array, it should be array of columnn numbers which you want to expand.
<cfset arr= [1,2]>
<cfspreadsheet action=”write” filename = “test1.xlsx” name=”store” autosize = “#arr#” overwrite=true>
By default value will be true for backward compatibility. We recommend users to keep it false