Status/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Tom McNeer / Tom McNeer (Tom McNeer)
Created: 03/11/2010
Components: Document Management, Office Integration
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 1
Duplicate ID: CF-3040949
Problem:
cfspreadsheet write fails when used inside cffunction
Method:
Given the following code: <cfset myQuery = queryNew("ID,Name")> <cfset queryAddRow(myQuery) /> <cfset querySetCell(myQuery,"ID",1) /> <cfset querySetCell(myQuery,"Name","Lucy")> <cfset queryAddRow(myQuery) /> <cfset querySetCell(myQuery,"ID",2) /> <cfset querySetCell(myQuery,"Name","Desi")> <cfdump var="#myQuery#"> <cfset path = "C:\lucy.xlsx" /> <cfdump var="#path#"> <cffunction name="build" access="public" returntype="any" output="false"> <cfargument name="myQuery" type="query" required="true" /> <cfargument name="path" type="string" required="true" /> <cfset var ss = spreadsheetNew("Desilu",true) /> <cfset spreadSheetAddRow(ss,"ID,Character Name")> <cfloop query="arguments.myQuery"> <cfset spreadsheetsetCellValue(ss,arguments.myQuery.ID, arguments.myQuery.currentRow+1,1) /> <cfset spreadsheetsetCellValue(ss,arguments.myQuery.Name, arguments.myQuery.currentRow+1,2) /> </cfloop> <!---<cfspreadsheet action="write" filename="#arguments.path#" name="ss" overwrite="true" sheetname="Fred" />---> <cfreturn ss> </cffunction> <cfset desilu = build(myQuery,path) /> <cfdump var="#desilu#"> <cfspreadsheet action="write" filename="#path#" name="desilu" overwrite="true" sheetname="Desilu" />The final cfspreadsheet tag will correctly write out a spreadsheet file. However, if the cfspreadsheet tag within the funciton is uncommented, it will fail with an error message indicating that the spreadsheet object is not defined or invalid.This may be worked around by using the spreadSheetWrite() funciton.
Result:
Specified variable ss is not-defined or invalid.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041132
External Customer Info:
External Company:
External Customer Name: Tom McNeer
External Customer Email: 6BD004EF442B07AC99201549
External Test Config: 03/11/2010
Attachments:
Comments: