最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp中将table表中的数据成功导成excel做法
时间:2022-06-30 10:11:26 编辑:袖梨 来源:一聚教程网
我最近刚作了一个项目,该项目的要求是将asp页面中丛书据库中提取的数据直接保存成为excel形式,刚开始我的为此想了好就才最终做了出来,在此和大家共同分享!!
---------------------------------------
脚本如下: dim Rs_code,Sql_code,Rs_date,Sql_date
If Request("Op")="Show" Then
sborder="0"
sbg1="bgcolor=Black"
sbg2="bgcolor=White"
Else
sborder="1"
sbg1=""
sbg2=""
If Request("Op")="Excel" Then
Response.ContentType = "application/msexcel"
Response.AddHeader "Content-disposition","inline; filename=1.xls"
ElseIf Request("Op")="DownLoad" Then
Response.ContentType = "application/msexcel"
FileName="("&Request("sYear")&"-"&Request("sMonth")&")**********(此处为你要做的程序名,自己定义)"
Response.AddHeader "Content-disposition","attachment; filename="&FileName&".xls"
End If
End If
%>
在上层的页面中必须给该页面传送:参数:比如QH_TJ_C_imbark.asp?Op=Show
--------------------------------------------
在要转换成excel输出的程序中必须要在如下部分添加:
cellspacing="1" cellpadding="1" align="center" >
---------------------------------------
脚本如下: dim Rs_code,Sql_code,Rs_date,Sql_date
If Request("Op")="Show" Then
sborder="0"
sbg1="bgcolor=Black"
sbg2="bgcolor=White"
Else
sborder="1"
sbg1=""
sbg2=""
If Request("Op")="Excel" Then
Response.ContentType = "application/msexcel"
Response.AddHeader "Content-disposition","inline; filename=1.xls"
ElseIf Request("Op")="DownLoad" Then
Response.ContentType = "application/msexcel"
FileName="("&Request("sYear")&"-"&Request("sMonth")&")**********(此处为你要做的程序名,自己定义)"
Response.AddHeader "Content-disposition","attachment; filename="&FileName&".xls"
End If
End If
%>
在上层的页面中必须给该页面传送:参数:比如QH_TJ_C_imbark.asp?Op=Show
--------------------------------------------
在要转换成excel输出的程序中必须要在如下部分添加:
相关文章
- 高德地图路线规划显示异常怎么办 07-09
- 漫蛙漫画官方版正版ios如何安装 07-09
- 胖东来官网地址-胖东来官方网站入口地址 07-09
- investopedia官网中文版入口-investopedia国内能用的官方网页版入口地址 07-09
- 一点文学txt小说网站入口-一点文学小说官网入口地址2026最新 07-09
- 易校园怎么绑定微信 07-09