标题:[求助]导出Excel表
只看楼主
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
结帖率:68.57%
 问题点数:0 回复次数:4 
[求助]导出Excel表

老师们:
怎么把下表导出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>】件&nbsp;重量【<font color='blue'><%=rs("WEIGHT1")%></font>】KG&nbsp;运费【<font color='blue'><%=rs("MONEY1")%></font>】元&nbsp;保费【<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>】件&nbsp;重量【<font color='blue'><%=rs("WEIGHT1")%></font>】KG&nbsp;运费【<font color='blue'><%=rs("MONEY1")%></font>】元&nbsp;保费【<font color='blue'><%=rs("ASSURANCEMONEY1")%></font>】元
</td>
</tr>
</table>

[此贴子已经被作者于2006-12-18 12:00:54编辑过]

搜索更多相关主题的帖子: Excel class div align 
2006-12-18 11:59
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
得分:0 
有老师为我解答吗?我很急!谢谢了。

我是农家的孩子,我有农家孩子的本色!
2006-12-18 13:33
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
得分:0 
我在等

我是农家的孩子,我有农家孩子的本色!
2006-12-18 16:17
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
得分:0 
我在等

我是农家的孩子,我有农家孩子的本色!
2006-12-18 17:47
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
得分:0 
我在等哦~~

我是农家的孩子,我有农家孩子的本色!
2006-12-20 11:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-110240-1-1.html




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

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