日期:2014-05-17  浏览次数:21010 次

我的 WEB 打印 报表 错在哪里?
<!--   #include   file= "conn.asp "   -->
<%  
sql   =   "Select   department,count(department)   From   personnel   group   by   department "  
Set   Rs   =   Server.CreateObject( "ADODB.Recordset ")  
Rs.Open   sql,conn,1,1
If   Rs.EOF   Then  
Response.End  
End   If  

%>  

<html>  

<p   align= "center "> <b> <font   size= "4 "> 公司员工统计表 </font> </b> </p>  
<div   align= "center ">  

<table   id= "data "   border= "1 "   width= "606 "   height= "53 "   cellpadding= "0 "   cellspacing= "0 "   style= "border-collapse:   collapse "   bordercolor= "#111111 ">    
<tr>  
<td   width= "93 "   height= "24 ">  
<p   align= "center "> <font   size= "2 "> 部门 </font> </td>  
<td   width= "78 "   height= "24 ">  
<p   align= "center "> <font   size= "2 "> 合计 </font> </td>  
<td   width= "413 "   height= "24 ">  
<p   align= "center "> <font   size= "2 "> 员工姓名 </font> </td>  
</tr>   <%  

hj=0
while   (not   rs.eof)  
departmenttmp=rs( "department ")  
sqlstr= "select   *   from   personnel   where   department= ' "&departmenttmp& " ' "  
Set   rss   =   Server.CreateObject( "ADODB.Recordset ")  
rss.Open   sqlstr,   conn   ,1,1
number=0  
while(not   rss.eof)  
rss.movenext  
number=number+1  
wend  
hj=hj+number  
rss.movefirst  
flag=0  
while(not   rss.eof)%>  
<tr>  
<%if   (flag=0)   then%>  
<td   width= "93 "   height= "24 "> <p   align= "center "> <font   size=2> <%=departmenttmp%> </font> </td>  
<td   width= "78 "   height= "24 "> <p   align= "center "> <font   size=2> <%=number%> </font> </td>  
<%else%>  
<td   width= "93 "   height= "24 "> <p   align= "center ">   </td>  
<td   width= "78 "   height= "24 "> <p   align= "center ">   </td>  
<%end   if%>  
<td   width= "413 "   height= "24 "> <p   align= "center "> <font   size=2> <%=rss( "name ")%> </font> </td>  
<% rss.movenext  
flag=flag+1  
wend%>  
</tr>  
<%rs.movenext
wend%>  
<tr>  
<td   w