<!--#include file="conn.asp"-->
我有这样一段程序,服务器是WIN2K SERVER,在我的客户端(我的机器)上可以生成EXCEL文件,但是在其他客户端无法生成EXCEL文件,不知道为什么?
我使用response.ContentType ="application/vnd.ms-excel"来生成EXCEL文件。
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询结果列表</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
</head>
<%
dim i,j
dim xh
xh=0
%>
<body bgcolor="#FFFFFF">
<%
dim sql
dim rs
dim ziduan
sql=session("n_tt")
ziduan=request("cc")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 没有满足条件的交工资料明细!</p>"
Response.Write "<center><br><br>请返回重新输入查询条件!<a href='javascript:history.back();'>返回</a>"
else
showContent
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<%
response.ContentType ="application/vnd.ms-excel"
%>
<table border="1" cellpadding="2" class="h1" cellspacing="0" style="border-collapse: collapse">
<tr>
<td nowrap bgcolor="#FFFFFF" ><CENTER>序号</CENTER></td>
<% if instr(ziduan,"gcbh")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>工程编号</center></td>
<% end if %>
<% if instr(ziduan,"gcmc")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>工程名称</center></td>
<% end if %>
<% if instr(ziduan,"wtdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>委托单位</center></td>
<% end if %>
<% if instr(ziduan,"sjdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>设计单位</center></td>
<% end if %>
<% if instr(ziduan,"sgdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>施工单位</center></td>
<% end if %>
<% if instr(ziduan,"gclb")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>工程类别</center></td>
<% end if %>
<% if instr(ziduan,"zlfzr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>质量负责人</center></td>
<% end if %>
<% if instr(ziduan,"gcgq")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>工程工期</center></td>
<% end if %>
<% if instr(ziduan,"yjrq")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>移交日期</center></td>
<% end if %>
<% if instr(ziduan,"yjr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>移交人</center></td>
<% end if %>
<% if instr(ziduan,"jsdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>接收单位</center></td>
<% end if %>
<% if instr(ziduan,"jsr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>接收人</center></td>
<% end if %>
<% if instr(ziduan,"zdsj")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>转档案室时间</center></td>
<% end if %>
<% if instr(ziduan,"bz")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><center>备注</center></td>
<% end if %>
</tr>
<%do while not rs.eof
xh=cstr(cint(xh)+1)
%>
<tr>
<td nowrap bgcolor="#FFFFFF" ><%=xh%> </td>
<% if instr(ziduan,"gcbh")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("gcbh")%> </td>
<% end if %>
<% if instr(ziduan,"gcmc")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("gcmc")%> </td>
<% end if %>
<% if instr(ziduan,"wtdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("wtdw")%> </td>
<% end if %>
<% if instr(ziduan,"sjdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("sjdw")%> </td>
<% end if %>
<% if instr(ziduan,"sgdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("sgdw")%> </td>
<% end if %>
<% if instr(ziduan,"gclb")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("gclb")%> </td>
<% end if %>
<% if instr(ziduan,"zlfzr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("zlfzr")%> </td>
<% end if %>
<% if instr(ziduan,"gcgq")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("gcgq")%> </td>
<% end if %>
<% if instr(ziduan,"yjrq")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("yjrq")%> </td>
<% end if %>
<% if instr(ziduan,"yjr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("yjr")%> </td>
<% end if %>
<% if instr(ziduan,"jsdw")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("jsdw")%> </td>
<% end if %>
<% if instr(ziduan,"jsr")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("jsr")%> </td>
<% end if %>
<% if instr(ziduan,"zdsj")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("zdsj")%> </td>
<% end if %>
<% if instr(ziduan,"bz")>0 then %>
<td nowrap bgcolor="#FFFFFF" ><%=rs("bz")%> </td>
<% end if %>
</tr>
<%
rs.movenext
loop
%>
</table>
<p><%
end sub
%></p>
</body>
</html>