【发布时间】:2016-08-17 15:59:32
【问题描述】:
问题: Excel 在 Microsoft Excel 2010 中显示空白屏幕。如果您使用的是 2007 版,则可以正常工作
生成 Excel 报告的代码 -
<cfheader name="Content-Disposition" value="attachment; filename=MyReports.xls" />
<cfcontent type="application/vnd.ms-excel" />
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<style> <!--table @page{} --> </style> <!--[if gte mso 9]><xml> <x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet> <x:Name></x:Name> <x:WorksheetOptions><x:Panes> </x:Panes></x:WorksheetOptions> </x:ExcelWorksheet></x:ExcelWorksheets></ x:ExcelWorkbook> </xml> <![endif]-->
我查看了 Microsoft 社区站点,但目前没有找到任何解决方案。 如果你们遇到类似的问题或者您认为上面的代码需要修改,请帮忙。
供参考:Excel 的 HTML 标记 - http://www.c-sharpcorner.com/article/creating-a-dynamic-excel-using-html/
【问题讨论】:
-
excel 2007 发布时我们遇到了类似的问题。我们的解决方案是停止使用 html 在 excel 中呈现数据并开始使用 POI。那是在电子表格标签进入 ColdFusion 之前。
标签: html excel coldfusion excel-2010 ms-office