【发布时间】:2013-07-18 21:24:15
【问题描述】:
我目前使用的是 CF 版本 9.0.1,我无法让 SpreadsheetAddImage 函数正确地将图像插入到我正在生成的电子表格中。我没有收到任何错误消息,只是图像没有显示在电子表格中。我还排除了查找图像或返回图像的任何问题(通过使用 cfimage writetobrowser 属性进行测试)。
我还从电子表格中删除了所有数据和格式,以排除覆盖该单元格内容的任何内容。只是想看看我能不能得到一张带图片的空白电子表格。
请参阅下面的示例代码。
<cfset sObj = SpreadsheetNew()>
<!--- <cfimage source="pathtomyimage.jpg" name="image"> --->
<cfset image_var = ImageRead("pathtomyimage.png")>
<cfset SpreadsheetAddRow(sObj, "")>
<cfset SpreadsheetAddImage(sObj,image_var,"png","1,1,1,1")>
...
<cffile action="readbinary" file="#dest_loc#" variable="export_file">
<cffile action="delete" file="#dest_loc#">
<cfheader name="Content-Disposition" value="inline; filename=#file_name#.xls">
<cfcontent type="application/vnd.msexcel" variable="#toBinary(export_file)#">
感谢任何反馈。谢谢。
【问题讨论】:
标签: excel coldfusion coldfusion-9 cfimage cfspreadsheet