asp導(dǎo)出excel文件最簡單方便的方法
更新時間:2014年08月07日 11:05:01 投稿:junjie
這篇文章主要介紹了asp導(dǎo)出excel文件最簡單方便的方法,幾行代碼就可以搞定,非常簡單實用,需要的朋友可以參考下
由于excel軟件能識別table格式的數(shù)據(jù),所以asp只需要輸出table格式的html代碼,同時設(shè)置好contenttype,增加保存為附件的響應(yīng)頭即可將輸出的html代碼保存為xls文件。
asp導(dǎo)出excel文件源代碼如下:
復(fù)制代碼 代碼如下:
<%
Response.ContentType = "application/excel"
Response.AddHeader "Content-Disposition", "attachment;filename=""xxxx.xls"""
%>
<table>
<%while not rs.eof %>
<tr><td>你的excel單元格內(nèi)容,有多個自己增加td</td></tr>
<%
rs.movenext
wend
%>
</table>
您可能感興趣的文章:
- asp.net導(dǎo)出Excel亂碼的原因及解決方法
- asp.net讀取excel文件的三種方法示例
- asp.net導(dǎo)出excel的簡單方法實例
- 三步將Asp.Net頁面輸出到EXCEL里
- ASP.NET中上傳并讀取Excel文件數(shù)據(jù)示例
- asp中把數(shù)據(jù)導(dǎo)出為excel的2種方法
- ASP.NET實現(xiàn)讀取Excel內(nèi)容并在Web上顯示
- Asp.Net使用Npoi導(dǎo)入導(dǎo)出Excel的方法
- Asp.net導(dǎo)出Excel/Csv文本格式數(shù)據(jù)的方法
- asp.net導(dǎo)出excel數(shù)據(jù)的常見方法匯總
- ASP.NET使用GridView導(dǎo)出Excel實現(xiàn)方法
- asp.net中EXCEL數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫的方法
- asp.net中Table生成Excel表格的方法
- 直接在線預(yù)覽Word、Excel、TXT文件之ASP.NET
- asp.net頁面中如何獲取Excel表的內(nèi)容
- asp實現(xiàn)excel中的數(shù)據(jù)導(dǎo)入數(shù)據(jù)庫
- 利用ASP輸出excel文件實例講解

