老师们:
怎么把下表导出Excel?谢谢!
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#B8E976">
<tr class="tdbg" >
<td width="4%" nowrap class="topbg"><div align="center">发件日期</div></td>
<td width="4%" nowrap class="topbg"><p align="center">发件公司名称</td>
<td width="4%" nowrap class="topbg"><div align="center">发件人</div></td>
<td width="11%" nowrap class="topbg"><div align="center">P O D 号</div></td>
<td width="4%" nowrap class="topbg"><div align="center">目的港</div></td>
<td width="4%" nowrap class="topbg"><div align="center">票数</div></td>
<td width="4%" nowrap class="topbg"><div align="center">件数</div></td>
<td width="4%" nowrap class="topbg"><div align="center">重量</div></td>
<td width="7%" nowrap class="topbg"><div align="center">运费</div></td>
<td width="7%" nowrap class="topbg"><div align="center">类型</div></td>
<td width="7%" nowrap class="topbg"><div align="center">保险</div></td>
<td width="7%" nowrap class="topbg"><div align="center">保费</div></td>
<td width="7%" nowrap class="topbg"><div align="center">结算</div></td>
<td width="7%" nowrap class="topbg"><div align="center">付款</div></td>
<td width="7%" nowrap class="topbg"><div align="center">取件员</div></td>
<%
If Len(Trim(Request("page")))=0 Then '返回目标页码的判断
page=1
Else
page=CInt(Trim(Request("page")))
End If
Dim BaoXian
set rs=Server.CreateObject("ADODB.RecordSet")
if request("DATA")="" and request("DATA1")="" then
sql="select CUSTOMERCODE,CUSTOMERNAME,CUSTOMERRELATION,CUSTOMERAREA,CUSTOMERSELL,DATA,GOODSTYPE,BANKNOTE,LETTER,WEIGHT,MONEY,OPERATOR,ASSURANCE,ASSURANCEMONEY,BALANCETYPE,GIVETYPE,DESTINATION,ODDNUMBERS FROM [ESDISPATCH] WHERE ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%' order by data desc"
ELSE
sql="select CUSTOMERCODE,CUSTOMERNAME,CUSTOMERRELATION,CUSTOMERAREA,CUSTOMERSELL,DATA,GOODSTYPE,BANKNOTE,LETTER,WEIGHT,MONEY,OPERATOR,ASSURANCE,ASSURANCEMONEY,BALANCETYPE,GIVETYPE,DESTINATION,ODDNUMBERS FROM [ESDISPATCH] WHERE DATA between #"&cdate(request("DATA"))&"# and #"&cdate(request("DATA1"))&"# AND ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%' order by data desc"
END IF
rs.open sql,conn,1,1
rs.PageSize=20
if not rs.eof then
BaoXian=Split(rs("ASSURANCE"),"-")
rs.AbsolutePage=page
for k=1 to rs.PageSize
%>
<tr valign="middle" class="tdbg" onmouseover="this.style.backgroundColor='#F6FcF9'" onmouseout="this.style.backgroundColor=''">
<td align="center" nowrap ><div align="left"><%=rs("DATA")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("CUSTOMERNAME")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("CUSTOMERRELATION")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("ODDNUMBERS")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("DESTINATION")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("BANKNOTE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("LETTER")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("WEIGHT")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("MONEY")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("GOODSTYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=BaoXian(1)%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("ASSURANCEMONEY")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("BALANCETYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("GIVETYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("OPERATOR")%></div></td>
</tr>
<%
rs.movenext
if rs.EOF Then Exit For
next
end if
%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td height="20" colspan="15" align="center" nowrap >
<%
if page <>1 then
Response.Write "<a href=wyfz_fineeschu.asp?page=1>【首页】</a> "
end if
tmppage = page - 1
if tmppage <= 0 then
tmppage = 1
else
Response.Write"<a href=wyfz_fineeschu.asp?page="&tmppage&">【上一页】</a>"
end if
tmppage = page + 1
if tmppage >rs.PageCount then
tmppage = page
else
Response.Write " <a href=wyfz_fineeschu.asp?page="&tmppage&">【下一页】</a> "
end if
if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
Response.Write "<a href=wyfz_fineeschu.asp?page="&rs.PageCount&">【尾页】</a>"
end if
if Cstr(rs.PageCount) <> 0 then
Response.Write " 每页显示【<font color=red>19</font>】条信息 第【<font color='blue'>" & page & "/"&rs.PageCount&"</font>】页"
end if
Response.Write " 共有【<font color='blue'>"&rs.RecordCount&"</font>】票"
rs.close
%>
<%
set rs=server.CreateObject("adodb.recordset")
if request("DATA")="" and request("DATA1")="" then
sql="select sum(LETTER) as LETTER1, sum(WEIGHT) as WEIGHT1,sum(MONEY) as MONEY1,sum(ASSURANCEMONEY) as ASSURANCEMONEY1 FROM ESDISPATCH WHERE ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%'"
ELSE
sql="select sum(LETTER) as LETTER1, sum(WEIGHT) as WEIGHT1,sum(MONEY) as MONEY1,sum(ASSURANCEMONEY) as ASSURANCEMONEY1 FROM ESDISPATCH WHERE DATA between #"&cdate(request("DATA"))&"# and #"&cdate(request("DATA1"))&"# AND ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%'"
END IF
rs.open sql,conn,1,1
%>【<font color='blue'><%=rs("LETTER1")%></font>】件 重量【<font color='blue'><%=rs("WEIGHT1")%></font>】KG 运费【<font color='blue'><%=rs("MONEY1")%></font>】元 保费【<font color='blue'><%=rs("ASSURANCEMONEY1")%></font>】元
</td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#B8E976">
<tr class="tdbg" >
<td width="4%" nowrap class="topbg"><div align="center">发件日期</div></td>
<td width="4%" nowrap class="topbg"><p align="center">发件公司名称</td>
<td width="4%" nowrap class="topbg"><div align="center">发件人</div></td>
<td width="11%" nowrap class="topbg"><div align="center">P O D 号</div></td>
<td width="4%" nowrap class="topbg"><div align="center">目的港</div></td>
<td width="4%" nowrap class="topbg"><div align="center">票数</div></td>
<td width="4%" nowrap class="topbg"><div align="center">件数</div></td>
<td width="4%" nowrap class="topbg"><div align="center">重量</div></td>
<td width="7%" nowrap class="topbg"><div align="center">运费</div></td>
<td width="7%" nowrap class="topbg"><div align="center">类型</div></td>
<td width="7%" nowrap class="topbg"><div align="center">保险</div></td>
<td width="7%" nowrap class="topbg"><div align="center">保费</div></td>
<td width="7%" nowrap class="topbg"><div align="center">结算</div></td>
<td width="7%" nowrap class="topbg"><div align="center">付款</div></td>
<td width="7%" nowrap class="topbg"><div align="center">取件员</div></td>
<%If Len(Trim(Request("page")))=0 Then '返回目标页码的判断
page=1
Else
page=CInt(Trim(Request("page")))
End IfDim BaoXian
set rs=Server.CreateObject("ADODB.RecordSet")
if request("DATA")="" and request("DATA1")="" then
sql="select CUSTOMERCODE,CUSTOMERNAME,CUSTOMERRELATION,CUSTOMERAREA,CUSTOMERSELL,DATA,GOODSTYPE,BANKNOTE,LETTER,WEIGHT,MONEY,OPERATOR,ASSURANCE,ASSURANCEMONEY,BALANCETYPE,GIVETYPE,DESTINATION,ODDNUMBERS FROM [ESDISPATCH] WHERE ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%' order by data desc"
ELSE
sql="select CUSTOMERCODE,CUSTOMERNAME,CUSTOMERRELATION,CUSTOMERAREA,CUSTOMERSELL,DATA,GOODSTYPE,BANKNOTE,LETTER,WEIGHT,MONEY,OPERATOR,ASSURANCE,ASSURANCEMONEY,BALANCETYPE,GIVETYPE,DESTINATION,ODDNUMBERS FROM [ESDISPATCH] WHERE DATA between #"&cdate(request("DATA"))&"# and #"&cdate(request("DATA1"))&"# AND ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%' order by data desc"
END IF
rs.open sql,conn,1,1
rs.PageSize=20
if not rs.eof then
BaoXian=Split(rs("ASSURANCE"),"-")
rs.AbsolutePage=page
for k=1 to rs.PageSize
%>
<tr valign="middle" class="tdbg" onmouseover="this.style.backgroundColor='#F6FcF9'" onmouseout="this.style.backgroundColor=''">
<td align="center" nowrap ><div align="left"><%=rs("DATA")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("CUSTOMERNAME")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("CUSTOMERRELATION")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("ODDNUMBERS")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("DESTINATION")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("BANKNOTE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("LETTER")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("WEIGHT")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("MONEY")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("GOODSTYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=BaoXian(1)%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("ASSURANCEMONEY")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("BALANCETYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("GIVETYPE")%></div></td>
<td align="center" nowrap ><div align="center"><%=rs("OPERATOR")%></div></td>
</tr>
<%
rs.movenext
if rs.EOF Then Exit For
next
end if
%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td height="20" colspan="15" align="center" nowrap >
<%
if page <>1 then
Response.Write "<a href=wyfz_fineeschu.asp?page=1>【首页】</a> "
end if
tmppage = page - 1
if tmppage <= 0 then
tmppage = 1
else
Response.Write"<a href=wyfz_fineeschu.asp?page="&tmppage&">【上一页】</a>"
end if
tmppage = page + 1
if tmppage >rs.PageCount then
tmppage = page
else
Response.Write " <a href=wyfz_fineeschu.asp?page="&tmppage&">【下一页】</a> "
end if
if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
Response.Write "<a href=wyfz_fineeschu.asp?page="&rs.PageCount&">【尾页】</a>"
end if
if Cstr(rs.PageCount) <> 0 then
Response.Write " 每页显示【<font color=red>19</font>】条信息 第【<font color='blue'>" & page & "/"&rs.PageCount&"</font>】页"
end if
Response.Write " 共有【<font color='blue'>"&rs.RecordCount&"</font>】票"
rs.close
%>
<%
set rs=server.CreateObject("adodb.recordset")
if request("DATA")="" and request("DATA1")="" then
sql="select sum(LETTER) as LETTER1, sum(WEIGHT) as WEIGHT1,sum(MONEY) as MONEY1,sum(ASSURANCEMONEY) as ASSURANCEMONEY1 FROM ESDISPATCH WHERE ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%'"
ELSE
sql="select sum(LETTER) as LETTER1, sum(WEIGHT) as WEIGHT1,sum(MONEY) as MONEY1,sum(ASSURANCEMONEY) as ASSURANCEMONEY1 FROM ESDISPATCH WHERE DATA between #"&cdate(request("DATA"))&"# and #"&cdate(request("DATA1"))&"# AND ODDNUMBERS like '%"&trim(request("ODDNUMBERS"))&"%' AND ( CUSTOMERCODE like '%"&trim(request("CUSTOMERCODE"))&"%' OR CUSTOMERNAME like '%"&trim(request("CUSTOMERCODE"))&"%' ) AND ( WEIGHT >= "&trim(request("WEIGHT"))&" ) AND DESTINATION like '%"&trim(request("DESTINATION"))&"%' AND GOODSTYPE like '%"&trim(request("GOODSTYPE"))&"%' AND ASSURANCE like '%"&trim(request("ASSURANCE"))&"%' AND BALANCETYPE like '%"&trim(request("BALANCETYPE"))&"%' AND GIVETYPE like '%"&trim(request("GIVETYPE"))&"%' AND OPERATOR like '%"&trim(request("OPERATOR"))&"%' AND CUSTOMERSELL like '%"&trim(request("CUSTOMERSELL"))&"%' AND CUSTOMERAREA like '%"&trim(request("CUSTOMERAREA"))&"%'"
END IF
rs.open sql,conn,1,1
%>【<font color='blue'><%=rs("LETTER1")%></font>】件 重量【<font color='blue'><%=rs("WEIGHT1")%></font>】KG 运费【<font color='blue'><%=rs("MONEY1")%></font>】元 保费【<font color='blue'><%=rs("ASSURANCEMONEY1")%></font>】元
</td>
</tr>
</table>
[此贴子已经被作者于2006-12-18 12:00:54编辑过]