最新下载
热门教程
- 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输出的程序中必须要在如下部分添加:
相关文章
- 1元10抖币官网直充入口-抖币充值iOS专享通道 10-28
- workbuddy电脑版官网下载-腾讯AI工作台官方入口直达 10-28
- workbuddy官网登录入口直达-腾讯workbuddy官方版下载获取 10-28
- mcjs网页版畅玩-mcjs极速秒玩 10-28
- yandex在线登录官网-俄罗斯引擎yandex官方入口 10-28
- 超星网页版登录入口-超星学习通官方登录地址 10-28