JS 页面打印

<%@ page contentType="text/html; charset=utf-8" %>
<%@taglib uri='/WEB-INF/html.tld' prefix='html' %> 
<%@taglib uri='/WEB-INF/org.tld' prefix='org' %> 
<%@ page import="java.util.List"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.ArrayList" %>
<%
    List list = (List)request.getAttribute("list");
    if(list == null){
       list = new ArrayList();
    }
%>
<html>
<head>
</head>
<style>
.font{
    font-size:5px;
    padding: 0px;0px;0px;0px;
}
td{font-size:12px;}
</style>
  <style media=print>
    .Noprint{display:none;}
    .PageNext{page-break-after: always;}
  </style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/main.css" rel="stylesheet" type="text/css">

 <script Language='JavaScript' src='js/public.js'></script>
 <script Language='JavaScript' src='js/pagecontrol.js'></script>
 <script src="js/prototype.js" type="text/javascript"></script>
 <script src="./app/js/app.js" type="text/javascript"></script>
 <script src="js/dateVerdict.js" type="text/javascript"></script>
 <script src="js/datepopcalendar.js" type="text/javascript"></script>
 <script src="js/tamcxSubmit.js" type="text/javascript"></script>
<script language="javascript">
function prt(){ 
    document.getElementById("prt_btn").style.display = "none"; 

    window.print(); 

    //部分还原回来 
    document.getElementById("prt_btn").style.display = ""; 
    return false; 
} 
</script>
<body oncontextmenu="return false" >
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0    id=WB width=0>
</OBJECT>
<%if (!list.isEmpty()) {%>
<div id="prt_btn">
    <table border="1" cellpadding="0" cellspacing="0" bordercolor="#333333"  class="Noprint">
        <tr>
            <td height="25" bgcolor="#D0D0D0" >
                <table width="1000px"  border="0"  cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <input type="button" value="打印设置" onclick="WB.ExecWB(8,1);">
                            <input type="button" value="打印预览" onclick="WB.ExecWB(7,1);">
                            <input type="button" value="打 印" onClick="javascript:prt()">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<div id="prt_div">
<table class="font" width="1000px" border="0" style="border-collapse:collapse" >
     <tr class="listThead"> 
          <td>机构号</td>
          <td>受理机构标识码</td>
          <td>接收机构标识码</td>
          <td>柜员流水号</td>
          <td>系统跟踪号</td>
          <td>交易日期</td>
          <td>交易时间</td>
          <td>交易名称</td>
          <td>币种</td>
          <td>交易金额</td>
          <td>响应信息</td>
          <td>状态</td>
          <td>交易柜员</td>
          <td>授权柜员</td>
        </tr>
        <% for(int i = 0;i<list.size();i++){
            Map map = (Map)list.get(i);
            String zt = (map.get("ZT")).toString();
            if("0".equals(zt)){
                zt = "0-成功";
            }else if("8".equals(zt)){
                zt = "8-冲正成功";
            }else {
             zt = zt+"-失败"; 
            }
            %>
            <%
            //分页显示的时候,第二页及后面的页带上标题,但是由于目前每页打印的记录数不定,所以该功能禁用,该功能只支持每页显示记录数为固定值
            //if(i%20 ==0 && i > 1){ %>
                <%--
                <tr class="listThead" style= 'page-break-before:always;'> 
                  <td>机构号</td>
                  <td>受理机构标识码</td>
                  <td>接收机构标识码</td>
                  <td>柜员流水号</td>
                  <td>系统跟踪号</td>
                  <td>交易日期</td>
                  <td>交易时间</td>
                  <td>交易名称</td>
                  <td>币种</td>
                  <td>交易金额</td>
                  <td>响应信息</td>
                  <td>状态</td>
                  <td>交易柜员</td>
                  <td>授权柜员</td>
                </tr>
                 --%>
             <%//} %>
        <tr class="listRow"> 
          <td><%=(map.get("JGDH")).toString()%></td>
          <td><%=(map.get("SLJGBSM")).toString()%></td>
          <td><%=(map.get("JSJGBSM")).toString()%></td>
          <!-- 汇入流水号经讨论暂存入yw_22_ywls的GYLSH字段 -->
          <td><%=(map.get("GYLSH")).toString()%></td>
          <td><%=(map.get("XTGZH")).toString()%></td>
          <td><%=(map.get("JYRQ")).toString()%></td>
          <td><%=(map.get("JYSJ")).toString()%></td>
          <td><%=(map.get("JYMC")).toString()%></td>
          <% request.setAttribute("hbzl", (String)map.get("HBZL"));%> 
          <td><!--<html:out  dataSource= "xybz,hbzl,1" />-->156-人民币</td>            
          <td><%=(map.get("JYJE")).toString()%></td>
          <td><%=(map.get("XYXX")).toString()%></td>
          <td><%=zt%></td>
          <td><%=(map.get("JYGY")).toString()%></td>
          <td><%=(map.get("SQGY")).toString()%></td>
        </tr>
        <%}%>
</table>
</div>
<% } else {%>
<b>查无记录,请调整查询条件</b>
<% } %>

</body>
</html>

 

posted @ 2014-08-23 09:38  残星  阅读(3401)  评论(1编辑  收藏  举报