导出到Excel不正确显示数字

编程入门 行业动态 更新时间:2024-10-26 18:28:46
本文介绍了导出到Excel不正确显示数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

将数据从数据库导出到Excel电子表格时,我很难得到帐号正确显示。一家公司的帐号正确显示。但是别人没有。用户必须双击单元格才能查看整个帐号。我已经google了这个问题,没有一个我试过的解决方案。

I'm having a hard time getting account numbers to display correctly when exporting data from database to an Excel spreadsheet. The account number for one company, shows up correctly. However, others don't. Users have to double click in the cell to see the whole account number. I have Googled this issue and none of the solutions that I've tried worked.

<cfsetting enablecfoutputonly="Yes"> <cfsavecontent variable="sTest"> <cfoutput> <table> <tr><th align="center">ATTUID</th> <th>Company Name</th> <th align="center">Account Number </th> <th align="center">Total Past Due Balance</th> <th align="center">Date Sent</th> </tr> <cfloop query="returnQuery"> <tr><td>#attuid#</td> <td>#companyname#</‌​td> <td>#AccountNum4#‌​</td> <td>#totalpastd‌​ue#</td> <td>#datefor‌​mat(posted)# #timeformat(posted, "h:mm tt")#</td> </tr> </cfloop> </table> </cfoutput> </cfsavecontent> <cfcontent type="application/vnd.msexcel"> <cfheader name="Content-Disposition" value="inline; filename=export.xls"> <cfoutput>#sTest#</cfoutput>

推荐答案

您可以在帐号前插入撇号。这将强制excel将数字(任何)数据视为文本。

You can insert an apostrophe ' preceding the account number. This will force excel to treat numeric (any) data as text.

更多推荐

导出到Excel不正确显示数字

本文发布于:2023-11-09 15:15:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572703.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不正确   数字   导出到   Excel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!