Whatever message this page gives is out now! Go check it out!
SpreadsheetAddImage(spreadsheet,imagePath,anchor,imageData,imageType)Parameter | Description |
spreadsheet | 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:
|
<cfchart format="png" scalefrom="-50" scaleTo="100" gridlines="5" name="myChart">
<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,myChart,"png","5,5,12,10");
SpreadSheetWrite(SpreadsheetObj,"#theDir#imagesheet.xls",true);
</cfscript><cfscript>
// Create a ColdFusion image of points
myImage=ImageNew("",400,400,"rgb","lightgray");
for (i=10;i<400;i++){
ImageSetDrawingColor(myImage,"black");
x=randRange(5,350);
y=randRange(10,300);
ImageDrawPoint(myImage,x,y);
}
// Add points to spreadsheet object and write to file
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
SpreadsheetObj=SpreadsheetNew();
SpreadsheetAddImage(SpreadsheetObj,myImage,"png","5,5,12,10");
SpreadSheetWrite(SpreadsheetObj,"#theDir#imagesheet1.xls",true);
</cfscript>