信封报表打印Word,可以参考

<!--#include file="ConnSql.asp"-->
<!--作者:谌忠辉 -->
<!--时间:2004-03-22 -->
<!--修改人:谌忠辉 -->
<!--修改时间:2004-03-22 --><html>

<head>
<title>信封报表打印</title>
</head>

<script language="javascript" src="js/Screen.js"></script>
</head>

<body>

<br>
<%     
   '等到文本缓冲完才显示   
   dim yb(6)
   response.buffer = true
   crmid=request("Crm_Id")
   sql="select Crm_Id,Crm_Xm,Crm_Xxdz,Crm_GzDw,Crm_Yb from Crm_KhXx where Crm_Id="&crmid
   set rs=Conn.DoExecute(sql)
   If (Rs.RecordCount=0) Then
    response.Write "<script language=javascript>alert('没有你所要的数据!');history.go(-1);</script>"
    response.End
   else
   Crm_Yb=rs("Crm_Yb")
   for i=0 to 5
    yb(i)=mid(Crm_Yb,i+1,1)
   next
   '告诉浏览器用word来显示文档内容   
   Response.ContentType = "application/msword"     
   '文档设定    
   response.AddHeader "content-disposition", "inline; filepassword=KhXf.doc"    
   %>
<div align="center">
 <table border="0" width="600" id="table7" height="340" bgcolor="#FFFFFF">
  <tr>
   <td colspan="5" height="30" width="578">
   <table border="0" width="203" id="table8" height="36">
    <tr>
     <td width="16" align="center">
     <p><font size="4" color="#000080"><b><%=yb(0)%></b></font></p>
     </td>
     <td width="16" align="center">
     <p><font size="4" color="#000080"><b><%=yb(1)%></b></font></p>
     </td>
     <td width="16" align="center">
     <p><font size="4" color="#000080"><b><%=yb(2)%></b></font></p>
     </td>
     <td width="16" align="center">
     <p><font size="4" color="#000080"><b><%=yb(3)%></b></font></p>
     </td>
     <td width="16" align="center">
     <p><font size="4" color="#000080"><b><%=yb(4)%></b></font></p>
     </td>
     <td width="16" align="center">
     <p><b><font color="#000080" size="4"><%=yb(5)%></font></b></p>
     </td>
    </tr>
   </table>
   </td>
   <td height="108" width="150" rowspan="3">
   <table border="0" width="100%" id="table9" height="100">
    <tr>
     <td>
     <p align="center"><font color="#FFFFFF">贴</font></p>
     <p align="center"><font color="#FFFFFF">邮</font></p>
     </td>
     <td>
     <p align="center"><font color="#FFFFFF">票</font></p>
     <p align="center"><font color="#FFFFFF">处</font></p>
     </td>
    </tr>
   </table>
   </td>
  </tr>
  <tr>
   <td width="18" height="44"></td>
   <td width="550" height="44" colspan="4"></td>
  </tr>
  <tr>
   <td width="18" height="40" rowspan="2"></td>
   <td width="550" height="22" colspan="4"> <b><%=rs("Crm_GzDw")%></b></td>
  </tr>
  <tr>
   <td width="550" height="16" colspan="4"><hr color="#000000" size="0" align="right">
   </td>
   <td height="16" width="150"></td>
  </tr>
  <tr>
   <td width="18" height="49" rowspan="2"></td>
   <td width="550" colspan="4" height="31"> <b><%=rs("Crm_XxDz")%></b></td>
   <td width="150" height="49" rowspan="2"></td>
  </tr>
  <tr>
   <td width="550" colspan="4" height="16"><hr color="#000000" size="0" align="right">
   </td>
  </tr>
  <tr>
   <td width="18"></td>
   <td width="176"></td>
   <td width="248" colspan="3">
   <p align="center"><b><font size="5"><%=rs("Crm_Xm")%></font><font size="5" color="#FF0000"> </font><font size="5">&lt;收&gt;</font></b></p>
   </td>
   <td width="150"></td>
  </tr>
  <tr>
   <td width="18" rowspan="6"></td>
   <td width="176" height="33" rowspan="2"></td>
   <td width="248" colspan="3" height="16"><hr color="#000000" size="0" noshade>
   </td>
   <td width="150" height="33" rowspan="2"></td>
  </tr>
  <tr>
   <td width="248" colspan="3" height="15"></td>
  </tr>
  <tr>
   <td width="176" height="19"></td>
   <td width="49" height="19"></td>
   <td width="339" colspan="3" height="19">
   <p align="right"><font color="#FFFFFF" size="4"><b>有限公司&nbsp;&nbsp;&nbsp; </b>
   </font></p>
   </td>
  </tr>
  <tr>
   <td width="176" height="20"></td>
   <td width="49" height="20">
   <p align="right"></p>
   </td>
   <td width="339" colspan="3" height="20">
   <p align="right"><font color="#FFFFFF"><font size="2">地址:福州市工业路北段洪山科技园6号楼2层</font>&nbsp;&nbsp;
   </font></p>
   </td>
  </tr>
  <tr>
   <td width="176" height="18"></td>
   <td width="49" height="18"></td>
   <td width="185" height="18"></td>
   <td width="145" height="18" colspan="2">
   <p align="left"><font color="#FFFFFF"> </font></p>
   </td>
  </tr>
  <tr>
   <td width="176" height="11"> </td>
   <td width="49" height="11"> </td>
   <td width="339" height="11" colspan="3">
   <p align="right"><font color="#FFFFFF">邮政编码:350002&nbsp;&nbsp; </font></p>
   </td>
  </tr>
 </table>
</div>

</body>

</html><% '关闭记录集    
 rs.close    
 set rs=nothing    
 response.flush    
 response.end
end if  %>

posted on 2004-04-05 13:00  乔本生涯a  阅读(879)  评论(0编辑  收藏  举报

导航