wordpress   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了导出到Microsoft Excel(2007)时,ColdFusion(9)在数字后神秘地删除字符“D”和“F”大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

以下是一些示例的代码片段: theSheet = SpreadsheetNew("Rates","True"); SpreadsheetAddRow(theSheet,"4A,4B,4C,4D,4E,4F,4G,4H,4I,4J"); SpreadsheetAddRow(theSheet,"4K,4L,4M,4N,4O,4P,4Q,4R,4S,4T"); SpreadsheetAddRow(the
以下是一些示例的代码片段:
theSheet = SpreadsheetNew("Rates","True");
SpreadsheetAddRow(theSheet,"4A,4B,4C,4D,4E,4F,4G,4H,4I,4J");
SpreadsheetAddRow(theSheet,"4K,4L,4M,4N,4O,4P,4Q,4R,4S,4T");
SpreadsheetAddRow(theSheet,"4U,4V,4W,4X,4Y,4Z,4D4,4F4");

<cfheader name="content-disposition" value="attachment; filename=#GetTickCount()#.xLSX">
<CFHEADER NAME="Expires" VALUE="#Now()#">
<cfcontent type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" variable="#SpreadsheetReadBinary(theSheet)#"/>

问题是“4D”和“4F”(而不是其他人)失去了’D’和’F’并被格式化为数字.

我试过这个:

formatText = StructNew();
formatText.dataformat="@";
SpreadsheetFormatcolumns(theSheet,formatText,"1-10");

我确认这将Excel中的格式设置为“文本”,但现在我只看到文本格式单元格中的数字4!我也试过使用’字符,但是当它在Excel中打开时,它只显示’而不是字面化单元格.

很奇怪;有谁知道发生了什么?

似乎解决方法是将单元格公式设置为文字“4D”.
theSheet = SpreadsheetNew("Rates",4J");
SpreadsheetSetCellFormula(theSheet,"""4D""",1,4);
SpreadsheetSetCellFormula(theSheet,"""4F""",6);
SpreadsheetAddRow(theSheet,4F4");

我仍然不知道为什么会发生这种情况,但我的想法是SpreadsheetAddRow()和SpreadsheetSetCell()将4D和4F解释为数字并解释D和F以及代表Double和Float的后缀,并在之后将它们删除转换.

您可以转到https://bugbase.adobe.com/index.cfm错误提交给Adobe.

大佬总结

以上是大佬教程为你收集整理的导出到Microsoft Excel(2007)时,ColdFusion(9)在数字后神秘地删除字符“D”和“F”全部内容,希望文章能够帮你解决导出到Microsoft Excel(2007)时,ColdFusion(9)在数字后神秘地删除字符“D”和“F”所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。