admin管理员组文章数量:1532657
2024年5月22日发(作者:)
Asp代码
EXCEL
<%
ResponstentType ="application/vn-excel"
RespondHeader "Content-Disposition", "attachment; filename=表格.xls"
%>
WORD
<%
Response.ContentType ="application/vnd.ms-word"
Response.AddHeader "Content-Disposition", "attachment; filename=文档.doc"
%>
导出为WORD时,若文档中含有表格,需要打打印,则要在导出的页面中加入下
面的样式。
Css代码
</style>
系统项目中的一个导出为EXCEL文件的实例代码如下:
Asp代码
<%Response.ContentType ="application/vnd.ms-excel"
RespondHeader "Content-Disposition", "attachment; filename=chengji.xls"%>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona">
.tableWg {border:1px solid #9bbde6;}
.tableWg tr{text-align:center;}
.tableWg td{ border-bottom:1px dotted #9bbde6; border-right:1px dotted #9bbde6;}
style>
<%sql=session("chengjisql")
response.Write hbwelect(sql,0,1,"",0,"",0,"tableWg")%>
<%set hbwl=nothing%>
版权声明:本文标题:ASP导出为Word或Excel的最简单方法 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1716388386a500909.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论