Description
Adds an image to an Excel spreadsheet object.
Returns
Does not return a value.
Category
Microsoft Office Integration
Function syntax
SpreadsheetAddImage(SpreadsheetObj, imageFilePath, anchor) |
See also
SpreadsheetAddColumn, SpreadsheetAddRow, SpreadsheetAddRows
History
ColdFusion 9: Added the function.
Parameters
Parameter |
Description |
---|---|
spreadsheetObj |
The Excel spreadsheet object to which to add the column. |
anchor |
The image location, as a comma delimited list in either of the following formats:
|
imageData |
A ColdFusion image object. |
imageFilePath |
The absolute path to the image file. |
imageType |
The image format, one of the following:
|
Usage
Example
The following example creates a PNG format chart, puts it in a new spread sheet as rows 5-12 and column 5-10, and saves the sheet to disk.
<cfchart format="png" scalefrom="-100" scaleTo="100" gridlines="5" name="test"> <cfchartseries type="line"> <cfchartdata item="Point1" value="-50"> <cfchartdata item="Point2" value="-25"> <cfchartdata item="Point3" value="1"> <cfchartdata item="Point4" value="25"> <cfchartdata item="Point5" value="50"> <cfchartdata item="Point6" value="75"> <cfchartdata item="Point7" value="99"> </cfchartseries> </cfchart> <cfscript> theDir=GetDirectoryFromPath(GetCurrentTemplatePath()); SpreadsheetObj=SpreadsheetNew(); SpreadsheetAddImage(SpreadsheetObj,test,"png","5,5,12,10"); </cfscript> <cfspreadsheet action="write" name=SpreadsheetObj filename="#theDir#imagesheet.xls" sheetname="chart" overwrite=true> |