Oops!  Sorry.

Here's the code that throws the error.  If you remove the CFLOOP tags, the 
addMergedRegion method becomes available.



Merged Cell Test <CFoutput>#now()#</cfoutput>

<cfset myQuery = QueryNew("REGION, STATE, ZIP", "VarChar, VarChar, 
VarChar")>
<cfset newRow = QueryAddRow(MyQuery, 1)>
<cfset temp = QuerySetCell(myQuery, "REGION", "CENTRAL", 1)>
<cfset temp = QuerySetCell(myQuery, "STATE", "MO", 1)>
<cfset temp = QuerySetCell(myQuery, "ZIP", "11111", 1)>

<CFSET WorkBook = 
createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init()>
<CFSET TargetSheet = WorkBook.createSheet("new sheet")/>
<cfset row = TargetSheet.createRow(5)/>
<cfset cell = row.createCell(1)/>
<cfset cell.setCellValue("With Loop")>
<cfset row = TargetSheet.createRow(8)/>
<cfset cell = row.createCell(1)/>
<cfset cell.setCellValue("Merged")>
<cfset cell = row.createCell(2)/>
<cfset cell.setCellValue("False")>
<cfset region = 
createObject("java","org.apache.poi.hssf.util.Region").init(8,1,8,6)/>

<CFLOOP query="myQuery">
 <cfset TargetSheet.addMergedRegion(region)/>
</CFLOOP>

<CFHEADER  name="Content-Disposition"  value="attachment; 
filename=OutputFile.xls">
<CFSCRIPT>
 context = getPageContext();
 context.setFlushOutput(false);
 response = context.getResponse().getResponse();
 response.reset();
 out = response.getOutputStream();
 response.setContentType("application/vnd.ms-excel");
 WorkBook.write(out);
 out.flush();
 response.reset();
 out.close();
</CFSCRIPT> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317526
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to