| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 674 人关注过本帖
标题:[求助] 怎么在以下的代码加入导出EXCEL的代码
只看楼主 加入收藏
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
结帖率:68.57%
收藏
 问题点数:0 回复次数:7 
[求助] 怎么在以下的代码加入导出EXCEL的代码

下一页

[此贴子已经被作者于2006-5-25 11:12:26编辑过]

搜索更多相关主题的帖子: EXCEL 代码 
2006-05-25 11:01
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 

[CODE]<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "checkinfoadmin.asp"-->
<!-- #include file="conn.asp" -->
<html>
<style type="text/css">
<!--
.style33 {color: #000000}
-->
</style>
<style type="text/css">
<!--
.style34 {font-size: 12px}
-->
</style>
<style type="text/css">
<!--
.style35 {color: #336699}
.style36 {color: #666666}
-->
</style>
<style type="text/css">
<!--
.style37 {font-size: 14px}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>:::中外运空运发展股份有限公司贵州分公司快件出港清单:::</title>
<link href="../css/fontsize.css" rel="stylesheet" type="text/css">
<link href="../css/input_form.css" rel="stylesheet" type="text/css">
<link href="../css/inputform1.css" rel="stylesheet" type="text/css">
<link href="../css/selectform.css" rel="stylesheet" type="text/css">
<link href="../css/inputform2.css" rel="stylesheet" type="text/css">
<link href="../css/inputform3.css" rel="stylesheet" type="text/css">
<link href="../css/inputform3.css" rel="stylesheet" type="text/css">
<link href="../css/link.css" rel="stylesheet" type="text/css">
<link href="../css/buttoncss.css" rel="stylesheet" type="text/css">
<link href="../css/inputchaxun.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(../pictures/0343.jpg);
}
.style11 {color: #0000FF}
.style26 {color: #660000; }
-->
</style>
<SCRIPT src="cityForecastQuery.files/date.js" type=text/javascript></SCRIPT>
</head>
<style type="text/css" media="print">
#div0 {display:none;}
</style>
<script>
function print(d){
for(i=0;i<2;i++){
if(i==d) eval("div"+i).style.visibility="visible";
else eval("div"+i).style.visibility="hidden";
}
document.all.wb.ExecWB(7,1);
for(i=0;i<2;i++){
eval("div"+i).style.visibility="visible";
}
}
</script>
<div id=div0>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0>
<embed width="0" height="0"></embed></OBJECT>

<IFRAME
id=CalFrame
style="DISPLAY: none; Z-INDEX: 100; LEFT: 66px; WIDTH: 181px; POSITION: absolute; TOP: 406px; HEIGHT: 176px"
name=calendarframe marginWidth=0 marginHeight=0
src="cityForecastQuery.files/commondate.htm" frameBorder=0 noResize
scrolling=no> </IFRAME>
<div id="Layer1" style="position:absolute; width:200px; height:150px; z-index:101; top: 421px; left: 173px;"></div>
<td width="100%" height="71" background="../pictures/0343.jpg"><p align="center"><font color="#660000"><img src="../pictures/fox.gif" width="35" height="31">&nbsp;</font><span class="style35 style37">&nbsp;◆&nbsp;E速快件出港综合查询窗口
2005.8 版 ◆</span></p>
<p><span class="style35"><font size="2">&nbsp;◆</font></span><span class="style36 style35"><span class="style35"><font size="2"><font size="2">下表是查询结果(理论统计数据和实际数据可能有所误差),数据较多,请稍做等待</font>.......查询人员:</font></span></span><span class="style35"><font size="2"><span class="style13"></font></span><font size="2"><span class="style35">【<span class="style11"><%=session("name")%><span class="style34 style34 style35">】</span></span></span></font></p></td>
<tr> </td></tr>
<tr>
<td background="../pictures/0343.jpg"><div align="right">

<table width="500" height="47" border="2" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" background="../pictures/01Copyright.gif" class="fontsize" style="border-collapse: collapse">
<form name=frm action="fineschool.asp" method="post" >
<tr align="center" valign="middle" >
<td width="16%" height="23" nowrap>
<div align="center"><font color="#000000">&nbsp;公司名称&nbsp;</font></div></td>
<td width="16%" nowrap>
<div align="center"><font size="2">
<input name="school_chaxun" type="text" id="school_chaxun" onMouseOver="this.focus();" size="12">
</font></div></td>
<td width="16%" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;起始日期&nbsp;</font>
</div></td>
<td width="16%" nowrap>
<div align="center">
<TABLE id=AutoNumber43 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><INPUT class=date-must title=起始日期 size=10 value=<%=date()-30%>
name=mawb_flightdate1Start></TD>
<TD><IMG id=dimg0 style="CURSOR: hand"
onclick=javascript:ShowCalendar(document.frm.dimg0,document.frm.mawb_flightdate1Start)
height=18 src="cityForecastQuery.files/advbutton.gif" width=18
border=0></TD>
</TR>
</TBODY>
</TABLE>
</div></td>
<td width="12%" nowrap>
<div align="center"><font color="#000000" size="2">类&nbsp; 型</font></div></td>
<td width="12%" nowrap>
<div align="center"><font size="2">
<input name="num_of_classes_chaxun" type="text" id="num_of_classes_chaxun2"onMouseOver="this.focus();" size="10">
</font></div></td>
<td width="10%" rowspan="2" nowrap>
<div align="center">
<input name="chaxun" type="submit" id="chaxun5" value="我要查询">
</div></td>
</tr>
<tr align="center" valign="middle">
<td width="16%" height="20" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;单&nbsp;&nbsp;&nbsp;&nbsp;号&nbsp;
</font></div></td>
<td width="16%" nowrap>
<div align="center">
<input name="num_of_grade_chaxun" type="text" id="num_of_grade_chaxun2"onMouseOver="this.focus();" size="12">
</div></td>
<td width="16%" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;截止日期&nbsp;</font>
</div></td>
<td width="16%" nowrap>
<div align="center">
<TABLE id=AutoNumber43 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><INPUT class=date-must size=10 value=<%=date()%>
name=mawb_flightdate1End></TD>
<TD><IMG id=dimg1 style="CURSOR: hand"
onclick=javascript:ShowCalendar(document.frm.dimg1,document.frm.mawb_flightdate1End)
height=18 src="cityForecastQuery.files/advbutton.gif" width=18
border=0></TD>
</TR>
</TBODY>
</TABLE>
</div></td>
<td width="12%" nowrap>
<div align="center"><font color="#000000">目的地</font></div></td>
<td width="12%" nowrap>
<div align="center"><font size="2">
<input name="num_of_fjd" type="text" id="num_of_bz_chaxun2" onMouseOver="this.focus();" size="10">
</font></div></td>
</tr>
</form>
</table>


</div>

</td>
</tr><tr><td background="../pictures/0343.jpg"><div align="right">
<p align="center">&nbsp;
<input type=button value=打印设置 onclick="wb.execwb(7,1)">
&nbsp;&nbsp;<input type=button onClick=document.all.wb.ExecWB(6,1) value="打印清单">
</p>
</div></td>
</tr>
<tr>
<td background="../pictures/0343.jpg"><div align="left"></div></td>
</tr>
</div>
<div id=div1>
<tr>
<td height="141" background="../pictures/0343.jpg">
<p><span class="style34 style34 style35">&nbsp;</span></p>
<p><span class="style34 style34 style35">&nbsp;<span class="style35 style37">◆</span>统计分析:&nbsp;
<%
dim toutputb'设置变量,总重量合计初始值为0
ps=""
toutputb=0
set rs=server.CreateObject("adodb.recordset")
if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc "
end if
rs.open sql,conn,1,1
if not rs.eof then
%>
<%
while not rs.eof

if ps<>rs("ps") then '写入重量

ps=rs("ps")

toutputb=toutputb+0

%>
<%

end if%>
<%

toutputb=toutputb+(rs("ps"))
'cint 取整数
rs.movenext

if rs.eof then

%>
<%

end if
wend
%>
<%
end if
%>
总票数为:【<span class="style11"><%=toutputb-0%></span>】&nbsp;票;
<%
dim toutputc'设置变量,总重量合计初始值为0
js=""
toutputc=0
set rs=server.CreateObject("adodb.recordset")
if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc "
end if
rs.open sql,conn,1,1
if not rs.eof then
%>
<%
while not rs.eof

if js<>rs("js") then '写入重量

js=rs("js")

toutputc=toutputc+0

%>
<%

end if%>
<%

toutputc=toutputc+(rs("js"))
'cint 取整数
rs.movenext

if rs.eof then

%>
<%

end if
wend
%>
<%
end if
%>
总件数为:【<span class="style11"><%=toutputc-0%></span>】&nbsp;件;
<%
dim toutput'设置变量,总重量合计初始值为0
num_of_students=""
toutput=0
set rs=server.CreateObject("adodb.recordset")
if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc "
end if
rs.open sql,conn,1,1
if not rs.eof then
%>
<%
while not rs.eof

if num_of_students<>rs("num_of_students") then '写入重量

num_of_students=rs("num_of_students")

toutput=toutput+0

%>
<%

end if%>
<%

toutput=toutput+(rs("num_of_students"))
'cint 取整数
rs.movenext

if rs.eof then

%>
<%

end if
wend
%>
<%
end if
%>
总重量为:【<span class="style11"><%=toutput-0%></span>】&nbsp;KG;
<%
dim toutputa
num_of_je=""
toutputa=0
set rs=server.CreateObject("adodb.recordset")
if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc "
end if
rs.open sql,conn,1,1
if not rs.eof then
%>
<%
while not rs.eof

if num_of_je<>rs("num_of_je") then '写入重量

num_of_je=rs("num_of_je")

toutputa=toutputa+0

%>
<%

end if%>
<%

toutputa=toutputa+(rs("num_of_je"))
'cint
rs.movenext

if rs.eof then

%>
<%

end if
wend
%>
<%
end if
%>
总金额为:【<span class="style11"><%=toutputa-0%></span>】元</span> </p>
<table width="1000" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999" style="border-collapse: collapse">
<tr align="center" valign="middle" class="fontsize">
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发 件 公 司&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发件人&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发 件 日 期&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33"><font size="4">&nbsp;e</font> 速POD&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;类型&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"><div align="center" class="style33">&nbsp;票数&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"><div align="center" class="style33">&nbsp;件数&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;重量&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;金额&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;目 的 地&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;取件员&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;备 注&nbsp;</div></td>
</tr>
<%
Dim Cschool
set rs=server.CreateObject("adodb.recordset")
'if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
'sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
'else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' and num_of_fjd like'%"&trim(request("num_of_fjd"))&"%' order by num_of_riqi desc "
'end if
rs.open sql,conn,1,1
if rs.recordcount <> 0 then
rs.movefirst
do while not rs.eof
Cschool=Split(rs("school"),"-")
%>
<tr align="center" valign="middle" class="fontsize">
<td height="22"> <div align="center">&nbsp;<%=Cschool(1)%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_fjr")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_riqi")%>&nbsp;</div></td>
<td height="22" > <div align="center">&nbsp;<%=rs("num_of_grade")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_classes")%>&nbsp;</div></td>
<td height="22"><div align="center">&nbsp;<%=rs("ps")%>&nbsp;</div></td>
<td height="22"><div align="center">&nbsp;<%=rs("js")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_students")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_je")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_fjd")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("qjy")%>&nbsp;</div></td>
<td height="22"> <div align="center" class="style26">&nbsp;<%=rs("num_of_bz")%>&nbsp;</div></td>
</tr>
<%
rs.movenext
loop
else
%>
<tr class="fontsize">
<td height="22" colspan="9" ><div align="center" class="style11 style35 style35 style35 style35"><font size="2">对不起,没查询到符合您需要的信息<span class="style11"><font size="2">!统计分析为数据库总的数据!</font></span></font></div></td>
</tr>
<%
end if
%>
</table>
<p>
<%
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
</p>
</div>
</tr>
</body>
</html>
<!--#include file="topy.asp"-->[/CODE]


我是农家的孩子,我有农家孩子的本色!
2006-05-25 11:08
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 

<!--#include file = "checkinfoadmin.asp"-->
<!-- #include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>:::中外运空运发展股份有限公司贵州分公司快件出港清单:::</title>
</style>
<SCRIPT src="cityForecastQuery.files/date.js" type=text/javascript></SCRIPT>
</head>
<style type="text/css" media="print">
#div0 {display:none;}
</style>
<script>
function print(d){
for(i=0;i<2;i++){
if(i==d) eval("div"+i).style.visibility="visible";
else eval("div"+i).style.visibility="hidden";
}
document.all.wb.ExecWB(7,1);
for(i=0;i<2;i++){
eval("div"+i).style.visibility="visible";
}
}
</script>
<div id=div0>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0>
<embed width="0" height="0"></embed></OBJECT>

<IFRAME
id=CalFrame
style="DISPLAY: none; Z-INDEX: 100; LEFT: 66px; WIDTH: 181px; POSITION: absolute; TOP: 406px; HEIGHT: 176px"
name=calendarframe marginWidth=0 marginHeight=0
src="cityForecastQuery.files/commondate.htm" frameBorder=0 noResize
scrolling=no> </IFRAME>
<div id="Layer1" style="position:absolute; width:200px; height:150px; z-index:101; top: 421px; left: 173px;"></div>
<td width="100%" height="71" background="../pictures/0343.jpg"><p align="center"><font color="#660000"><img src="../pictures/fox.gif" width="35" height="31">&nbsp;</font><span class="style35 style37">&nbsp;◆&nbsp;E速快件出港综合查询窗口
2005.8 版 ◆</span></p>
<p><span class="style35"><font size="2">&nbsp;◆</font></span><span class="style36 style35"><span class="style35"><font size="2"><font size="2">下表是查询结果(理论统计数据和实际数据可能有所误差),数据较多,请稍做等待</font>.......查询人员:</font></span></span><span class="style35"><font size="2"><span class="style13"></font></span><font size="2"><span class="style35">【<span class="style11"><%=session("name")%><span class="style34 style34 style35">】</span></span></span></font></p></td>
<tr> </td></tr>
<tr>
<td background="../pictures/0343.jpg"><div align="right">

<table width="500" height="47" border="2" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" background="../pictures/01Copyright.gif" class="fontsize" style="border-collapse: collapse">
<form name=frm action="fineschool.asp" method="post" >
<tr align="center" valign="middle" >
<td width="16%" height="23" nowrap>
<div align="center"><font color="#000000">&nbsp;公司名称&nbsp;</font></div></td>
<td width="16%" nowrap>
<div align="center"><font size="2">
<input name="school_chaxun" type="text" id="school_chaxun" onMouseOver="this.focus();" size="12">
</font></div></td>
<td width="16%" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;起始日期&nbsp;</font>
</div></td>
<td width="16%" nowrap>
<div align="center">
<TABLE id=AutoNumber43 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><INPUT class=date-must title=起始日期 size=10 value=<%=date()-30%>
name=mawb_flightdate1Start></TD>
<TD><IMG id=dimg0 style="CURSOR: hand"
onclick=javascript:ShowCalendar(document.frm.dimg0,document.frm.mawb_flightdate1Start)
height=18 src="cityForecastQuery.files/advbutton.gif" width=18
border=0></TD>
</TR>
</TBODY>
</TABLE>
</div></td>
<td width="12%" nowrap>
<div align="center"><font color="#000000" size="2">类&nbsp; 型</font></div></td>
<td width="12%" nowrap>
<div align="center"><font size="2">
<input name="num_of_classes_chaxun" type="text" id="num_of_classes_chaxun2"onMouseOver="this.focus();" size="10">
</font></div></td>
<td width="10%" rowspan="2" nowrap>
<div align="center">
<input name="chaxun" type="submit" id="chaxun5" value="我要查询">
</div></td>
</tr>
<tr align="center" valign="middle">
<td width="16%" height="20" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;单&nbsp;&nbsp;&nbsp;&nbsp;号&nbsp;
</font></div></td>
<td width="16%" nowrap>
<div align="center">
<input name="num_of_grade_chaxun" type="text" id="num_of_grade_chaxun2"onMouseOver="this.focus();" size="12">
</div></td>
<td width="16%" nowrap>
<div align="center"><font color="#000000" size="2">&nbsp;截止日期&nbsp;</font>
</div></td>
<td width="16%" nowrap>
<div align="center">
<TABLE id=AutoNumber43 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><INPUT class=date-must size=10 value=<%=date()%>
name=mawb_flightdate1End></TD>
<TD><IMG id=dimg1 style="CURSOR: hand"
onclick=javascript:ShowCalendar(document.frm.dimg1,document.frm.mawb_flightdate1End)
height=18 src="cityForecastQuery.files/advbutton.gif" width=18
border=0></TD>
</TR>
</TBODY>
</TABLE>
</div></td>
<td width="12%" nowrap>
<div align="center"><font color="#000000">目的地</font></div></td>
<td width="12%" nowrap>
<div align="center"><font size="2">
<input name="num_of_fjd" type="text" id="num_of_bz_chaxun2" onMouseOver="this.focus();" size="10">
</font></div></td>
</tr>
</form>
</table>


</div>

</td>
</tr><tr><td background="../pictures/0343.jpg"><div align="right">
<p align="center">&nbsp;
<input type=button value=打印设置 onclick="wb.execwb(7,1)">
&nbsp;&nbsp;<input type=button onClick=document.all.wb.ExecWB(6,1) value="打印清单">
</p>
</div></td>
</tr>
<tr>
<td background="../pictures/0343.jpg"><div align="left"></div></td>
</tr>
</div>
<div id=div1>
<tr>
<table width="1000" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999" style="border-collapse: collapse">
<tr align="center" valign="middle" class="fontsize">
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发 件 公 司&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发件人&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;发 件 日 期&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33"><font size="4">&nbsp;e</font> 速POD&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;类型&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"><div align="center" class="style33">&nbsp;票数&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"><div align="center" class="style33">&nbsp;件数&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;重量&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;金额&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;目 的 地&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;取件员&nbsp;</div></td>
<td height="23" nowrap background="../pictures/01menu_bg.gif"> <div align="center" class="style33">&nbsp;备 注&nbsp;</div></td>
</tr>
<%
Dim Cschool
set rs=server.CreateObject("adodb.recordset")
'if request("mawb_flightdate1Start")="" and request("mawb_flightdate1End")="" then
'sql= "select * from school where school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' order by num_of_riqi desc"
'else
sql="select * from school where num_of_riqi between #"&cdate(request("mawb_flightdate1Start"))&"# and #"&cdate(request("mawb_flightdate1End"))&"# and school like '%"&trim(request("school_chaxun"))&"%'and num_of_classes like '%"&trim(request("num_of_classes_chaxun"))&"%' and num_of_grade like'%"&trim(request("num_of_grade_chaxun"))&"%'and num_of_bz like'%"&trim(request("num_of_bz_chaxun"))&"%' and num_of_fjd like'%"&trim(request("num_of_fjd"))&"%' order by num_of_riqi desc "
'end if
rs.open sql,conn,1,1
if rs.recordcount <> 0 then
rs.movefirst
do while not rs.eof
Cschool=Split(rs("school"),"-")
%>
<tr align="center" valign="middle" class="fontsize">
<td height="22"> <div align="center">&nbsp;<%=Cschool(1)%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_fjr")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_riqi")%>&nbsp;</div></td>
<td height="22" > <div align="center">&nbsp;<%=rs("num_of_grade")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_classes")%>&nbsp;</div></td>
<td height="22"><div align="center">&nbsp;<%=rs("ps")%>&nbsp;</div></td>
<td height="22"><div align="center">&nbsp;<%=rs("js")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_students")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_je")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("num_of_fjd")%>&nbsp;</div></td>
<td height="22"> <div align="center">&nbsp;<%=rs("qjy")%>&nbsp;</div></td>
<td height="22"> <div align="center" class="style26">&nbsp;<%=rs("num_of_bz")%>&nbsp;</div></td>
</tr>
<%
rs.movenext
loop
else
%>
<tr class="fontsize">
<td height="22" colspan="9" ><div align="center" class="style11 style35 style35 style35 style35"><font size="2">对不起,没查询到符合您需要的信息<span class="style11"><font size="2">!统计分析为数据库总的数据!</font></span></font></div></td>
</tr>
<%
end if
%>
</table>
<p>
<%
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
</p>
</div>
</tr>
</body>
</html>

我是农家的孩子,我有农家孩子的本色!
2006-05-25 11:16
llingma
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2006-5-19
收藏
得分:0 
在ASP开始处加
Response.ContentType = "application/vnd.ms-excel"
filename="***"
Response.AddHeader "content-disposition", "attachment; filename=" & filename & ".xls"

2006-05-25 12:49
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
我想加一个按钮,点击按钮的时候,就会导出EXECT来!

我是农家的孩子,我有农家孩子的本色!
2006-05-25 13:55
llingma
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2006-5-19
收藏
得分:0 

新加一个ASP,然后将要导出内容写入该ASP中(可以将页面中显示内容放入该ASP中),然后页面头加前面我说的那几句话


2006-05-25 14:43
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
我只想导出查询的结果!如果按照您的意思!会不步把所有的的内容都导出来啦?

我是农家的孩子,我有农家孩子的本色!
2006-05-26 08:46
程序错误
Rank: 1
等 级:新手上路
帖 子:52
专家分:0
注 册:2006-4-30
收藏
得分:0 

在导出的时候加上同样的查询条件


天因你而更蔚蓝~~~~~~
地狱因我而黑暗~~~~~~
2006-05-26 09:34
快速回复:[求助] 怎么在以下的代码加入导出EXCEL的代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024082 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved