spreadsheetAddimage

Adds an image to an Excel spreadsheet object.

spreadsheetAddimage(spreadsheetObj, imagefilepath, anchor) → returns void

Argument Reference

spreadsheetObj variableName
Required

No Help Available

imagefilepath string
Required

No Help Available

anchor string
Required

No Help Available

Examples
Sample code invoking the spreadsheetAddimage function

The following example creates a PNG format chart, puts it in a new spreadsheet as rows 5-12 and column 5-10, and saves the sheet to disk.

<cfchart format="png" name="image_var"> 
     <cfchartseries type="line"> 
         <cfchartdata item="Point1" value="-50"> 
         <cfchartdata item="Point2" value="-25"> 
         <cfchartdata item="Point3" value="1"> 
 </cfchartseries> 
 </cfchart> 
 <cfset sObj = SpreadsheetNew()> 
 <cfset SpreadsheetAddRow(sObj, "")> 
 <cfset SpreadsheetAddImage(sObj,image_var,"png","1,1,7,6")> 
 <cfheader name="Content-Disposition" value="inline; filename=testFile.xls"> 
 <cfcontent type="application/vnd.msexcel" variable="#SpreadSheetReadBinary(sObj)#"> 

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub