tracker issue : CF-3620866

select a category, or use search below
(searches all categories and all time range)
Title:

cfspreadsheet update action works slow for formatted excel cells

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / Katsuhito Oinuma (Md. Kaif Akbar Quraishi)

Created: 08/28/2013

Components: Charting/Graphing, Client

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: 10,285437 / 286006

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win8 Server 64-bit

Vote Count: 0

Problem:
<cfspreadsheet action="update"> get processed very slowly when there is format style in the cell. It is particularly observed when Text Format is applied to the cell(s) where texts should be inserted.


Method:
Sample files which reproduce the problem: 
 -nonworking.cfm 
 -problem.xlsx 

 Sample files which do not reproduce the problem: 
 -working.cfm 
 -sample.xlsx 

Below are code for nonworking.cfm
------------------------------------------------
<cfscript>
   qRead_hoge = queryNew("id,fname,lname,dept,email");

for(i=0;i<500;i++){
   addRow(qRead_hoge, 'simeon','bateman','IT',':simeon@eee.net');
}

   function addRow( qry, fname, lname, dept, email){
      queryAddRow(qry);
      querySetCell(qry,'fname',fname);
      querySetCell(qry,'lname',lname);
      querySetCell(qry,'dept',dept);
      querySetCell(qry,'email',email);
   }
</cfscript>
<!---
<cfquery dbtype="query" name="qRead_hoge">
   SELECT *
   FROM rs
   ORDER BY dept
</cfquery>
--->

<cfoutput>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
	<meta http-equiv="cache-control" content="no-cache">
	<TITLE>test sample</TITLE>
</head>
<body>
	<p><h3>Excel test(problem)<br>
	test1: action=write<br>
	test2: action=update  (problem.xlsx is default format style)
	</h3></p>
	<br>	
	<cfif qRead_hoge.RECORDCOUNT neq 0>
		<cfoutput>SpreadsheetRead test1 Start?#Now()#</cfoutput><br>
		<cfset THESHEET = SpreadsheetRead("#expandPath('.')#/problem.xlsx","Sheet1")>
		<cfoutput>SpreadsheetRead test1 End?#Now()#</cfoutput><br>
		
		<!--- exel output --->
		<cfoutput>SpreadsheetAddRows test1 Start?#Now()#</cfoutput><br>
		<cfset SpreadsheetAddRows(THESHEET, qRead_hoge, 6,2,false)>
		<cfoutput>SpreadsheetAddRows test1 End?#Now()#</cfoutput><br>
		
		<cfoutput>SpreadsheetFormatCellRange test1 Start?#Now()#</cfoutput><br>
		<cfset FORMAT_M3 = structnew()>
		<cfset FORMAT_M3.TOPBORDER    = "thin">
		<cfset FORMAT_M3.BOTTOMBORDER = "thin">
		<cfset FORMAT_M3.RIGHTBORDER  = "thin">
		<cfset FORMAT_M3.LEFTBORDER   = "thin">
		<cfset SpreadsheetFormatCellRange(THESHEET,FORMAT_M3,6,2,6+qRead_hoge.RECORDCOUNT,13)>
		<cfoutput>SpreadsheetFormatCellRange test1 End?#Now()#</cfoutput><br>
<br>
<strong>
		<cfoutput>cfspreadsheet action=write test Start?#Now()#</cfoutput><br>
		<cfspreadsheet action="write" filename="#expandPath('.')#/result.xlsx" name="THESHEET" overwrite=true>
		<cfoutput>cfspreadsheet action=write test End?#Now()#</cfoutput><br>
</strong>
<br>
		
		<cfoutput>SpreadsheetRead test2 Start?#Now()#</cfoutput><br>
		<cfset THESHEET = SpreadsheetRead("#expandPath('.')#/problem.xlsx","Sheet1")>
		<cfoutput>SpreadsheetRead test2 End?#Now()#</cfoutput><br>
		
		<cfoutput>SpreadsheetAddRows test2 Start?#Now()#</cfoutput><br>
		<cfset SpreadsheetAddRows(THESHEET, qRead_hoge, 6,2,false)>
		<cfoutput>SpreadsheetAddRows test2 End?#Now()#</cfoutput><br>

		<cfoutput>SpreadsheetFormatCellRange test2 Start?#Now()#</cfoutput><br>
		<cfset SpreadsheetFormatCellRange(THESHEET,FORMAT_M3,6,2,6+qRead_hoge.RECORDCOUNT,13)>
		<cfoutput>SpreadsheetFormatCellRange test2 End?#Now()#</cfoutput><br>
<br>
<Strong>		
		<cfoutput>cfspreadsheet action=update test Start?#Now()#</cfoutput><br>
		<cfspreadsheet action="update" filename="#expandPath('.')#/result.xlsx" name="THESHEET" sheetname="Sheet3">
		<cfoutput>cfspreadsheet action=update test End?#Now()#</cfoutput><br>
</Strong>
	</cfif>
    <br>
</body>
</html>
</cfoutput>
------------------------------------------------

Result:
It works slow and takes more than twice time the time taken for un-formatted cells, sometimes takes even more.

Expected:
It should take time as mostly same time as taken for un-formatted cells

Workaround:
Need to be identified

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3620866

External Customer Info:
External Company: samuraiz corporation
External Customer Name: Katsuhito Oinuma
External Customer Email: sam18533@adobe.com

Attachments:

Comments:

fix verified with CF10 u12 (build 286387) on Win 7 x64. update action now takes 2-3 times as compared to 20-30 times before.
Comment by Piyush K.
14619 | October 29, 2013 06:43:16 AM GMT