将数据从数据库导出到 Excel 电子表格时,我很难让帐号正确显示。一家公司的帐号正确显示。然而,其他人没有。用户必须双击单元格才能看到整个帐号。我已经用谷歌搜索了这个问题,但我尝试过的解决方案都没有奏效。
<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>