I am using the custom CFX_Query2Excel and CFX_Excel2Query tags to write and read data from and to Excel. That's fine when value placement is fairly trivial (consecutive rows and columns). However, I have a customer who has a highly customized Excel file that is used as a form rather than a spreadsheet. Data is truly "shotgunned" all over the place.
My need then is to take (say) field0.value and put it in cell b6, field1.value in cell g19, etc. I suspect one way to do this is to write a lot of XML code. Another seems to be this: I found a nice component called cfHSSF at
http://cfhssf.riaforge.org/ that is promising. It makes use of POI to create and modify Excel workbooks and sheets. I'm not having success. Code snippet from the component:
-------------------
<cffunction name="createSheet" returntype="any" output="no" hint="I create a new sheet">
<!---
Sheets need to be created before the workBook creation!
--->
<cfargument type="any" name="workbook" default="wb">
<cfargument type="string" name="sheetName" required="Yes">
<cfreturn workbook.createSheet(sheet
Name)>
</cffunction>
-------------------
My calling code:
-------------------
<cfinvoke component="cfHSSF" method="createSheet" returnvariable="XLSheet" workbook="TestWB" sheetName="TestSheet"></cf
invoke>
-------------------
And finally, the IE8 output:
-------------------
The createSheet method was not found.
Either there are no methods with the specified method name and argument types, or the createSheet method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that matched the provided arguments. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.
The error occurred in C:\websites\a4kxhc\SSL\cfc
\cfExcel.c
fc: line 46
44 : <cfargument type="any" name="workbook" default="wb">
45 : <cfargument type="string" name="sheetName" required="Yes">
46 : <cfreturn workbook.createSheet(sheet
Name)>
47 : </cffunction>
48 : <!---
-------------------
I have contacted the author, but he seems to be busy, hence I'm here. Have also contacted the hosting company (Hosting.com), but no answers so far.
Regards.