本文介绍了导出到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>#totalpastdue#</td> <td>#dateformat(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不正确显示数字
发布评论