通过本文主要向大家介绍了asp 导出excel,asp导出excel源码,asp导出excel实例,asp导出数据到excel,导出excel asp.net等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
由于excel软件能识别table格式的数据,所以asp只需要输出table格式的html代码,同时设置好contenttype,增加保存为附件的响应头即可将输出的html代码保存为xls文件。
asp导出excel文件源代码如下:
<%
Response.ContentType = "application/excel"
Response.AddHeader "Content-Disposition", "attachment;filename=""xxxx.xls"""
%>
<table>
<%while not rs.eof %>
<tr><td>你的excel单元格内容,有多个自己增加td</td></tr>
<%
rs.movenext
wend
%>
</table>
</div>