注册 | 登录   
当前位置:网站首页 > 资源显示

aspASP导出为Word或Excel的最简单方法

发布时间:2017/5/2 22:29:13 / 最后修改:2017-5-4 15:09:03 / 浏览:726
1.EXCEL(由于excel软件能识别table格式的数据,所以asp只需要输出table格式的html代码,同时设置好contenttype,增加保存为附件的响应头即可将输出的html代码保存为xls文件
<%   
Response.ContentType ="application/vnd.ms-excel"

Response.AddHeader "Content-Disposition", "attachment; filename=表格.xls"  

%>  

或者

<%
Response.ContentType = "application/excel"
Response.AddHeader "Content-Disposition", "attachment;filename=""xxxx.xls"""
%>

 
2.WORD   
<%   
Response.ContentType ="application/vnd.ms-word"  
Response.AddHeader "Content-Disposition", "attachment; filename=文档.doc"  
%>  
您尚未登录,暂时无法查阅资源!立即登录
插播广告区
您尚未登录,暂时无法发表评论。立即登录
暂无任何评论
广告区
CopyRight © 2017 www.kaifaku.cn All Rights Reserved - 版权所有 © 开发库 (所有资源来源于实战项目,拿来即用)
付费资源请联系 QQ:2633993818 / E-MAIL:2633993818@qq.com 本站免费分享资源不提供免费咨询