`

web打印

    博客分类:
  • web
阅读更多
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ include file="/common/common.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
    <title>暂住证</title>
     <link href="../css/style1.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
.div2 {
font-family: "宋体";
font-size: 14px;
line-height: 40px;
color: #000000;
text-indent: 2px;
}
#bg {
position:absolute;
width:183.5mm;
height:263mm;
z-index:-1;
left: 0px;
top: 0px;
}
#table1div{
position:absolute;
width:146.5mm;
height:181mm;
z-index:4;

}

.td1width
{
width:24mm;
}
.td2width
{
width:27.5mm;
}
.td3width
{
width:19mm;
}

.td4width
{
width:8mm;
}

.td5width
{
width:10mm;
}

.td6width
{
width:6.5mm;
}

.td7width
{
width:20.5mm;
}
.td8width
{
width:27mm;
}
.trheight10
{
height:9.5mm;
}
.px13
{
font-size:13px;
}
#Layer1 {
position:absolute;
width:388px;
height:113px;
z-index:5;
left: 255px;
top: 805px;

}
</style>
  </head>
 
  <body bgcolor="#ffffff" leftmargin="0" topmargin="0">
    <div name="printDiv" id="printDiv"  >
  <table class="div2" width="305" border="0"  align="center">
        <tr >
          <td width="65"  height="12" class="div2" >姓&nbsp;名</td>
          <td width="55" class="div2">${zzrkjbxx.ZZRKXM }</td>
          <td width="65" class="div2">出生日期</td>
          <td width="40" class="div2">${zzrkjbxx.ZZRKCSRQ }</td>
          <td rowspan=4" width="70" valign="top"><img src="/showimage.do?method=showPrintImage&ryid=${zzrkjbxx.ZZRKRYID}" border="0" align="absbottom" style="width:70;"></td>
        </tr>
        <tr>
          <td class="div2">性&nbsp;别</td>
          <td class="div2">${zzrkjbxx.ZZRKXB }</td>
          <td class="div2">民&nbsp;族</td>
          <td class="div2">${zzrkjbxx.ZZRKMZ }</td>
        </tr>
        <tr>
          <td class="div2">婚姻状况</td>
          <td class="div2">${zzrkfjxx.ZZRKHYZK }</td>
          <td class="div2">暂住事由</td>
          <td class="div2">${zzrkzzxx.ZZRKZZSY }</td>
        </tr>
        <tr>
          <td class="div2"  colspan="4">户口所在地&nbsp;&nbsp;${zzrkjbxx.ZZRKHKSZDZZ }</td>
        </tr>
        <tr>
          <td class="div2">住&nbsp;址</td>
          <td  colspan="4" class="div2">${zzrkzzxx.ZZRKJZDZ }</td>
     
        </tr>
        <tr>
          <td class="div2">服务处所</td>
          <td  colspan="4" class="div2">${zzrkzzxx.ZZRKFWCS }</td>
         
        </tr>
        <tr>
          <td class="div2">身份证号</td>
          <td colspan="4" class="div2">${zzrkjbxx.ZZRKGMSFHM }</td>
      
        </tr>
</table>
<table  width="305" border="0" align="center">
        <tr>
          <td class="div2" valign="top" height="30">${fn:substring(zzrkzzxx.ZZRKJZZQFRQ,0,4)}&nbsp;&nbsp;&nbsp;
         年&nbsp;${fn:substring(zzrkzzxx.ZZRKJZZQFRQ,4,6)}&nbsp;月${fn:substring(zzrkzzxx.ZZRKJZZQFRQ,6,8)}日签发&nbsp;
        有效日期&nbsp;${zzrkzzxx.ZZRKYXQX }</td>
        </tr>
      </table>
</div>
  <table border="0" align="center" cellpadding="0" cellspacing="0" style="width:200mm;">
    <tr>
        <td style="border-bottom:1px dotted #000000;" height="20">&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
    </tr>
</table>
<div align="center">
    <table border="0" align="center" cellpadding="0" cellspacing="0" style="width:320">
        <tr>
            <td><input type="button" value="打印" onClick="javascript:printObj(printDiv,'6','6')" class="NOPRINT"
                       style="height:20px;"></td>
            <td>
                <input type="button" value="页面设置" onClick="javascript:printObj(printDiv,'8','1')" class="NOPRINT"
                       style="height:20px;">
            </td>
            <td><input type="button" value="打印预览" onClick="javascript:printObj(printDiv,'7','1')" class="NOPRINT"
                       style="height:20px;"></td>
            <td><input type="button" value="关闭" onClick="javascript:window.close();" class="NOPRINT"
                       style="height:20px;"></td>
            <td>&nbsp;</td>
        </tr>
    </table>
</div>
  </body>
</html>

<script language="javascript">
    function printObj(obj, p1, p2)
    {
        var printFlag = true;
        if (p1 == "6")
        {
            printFlag = false;
            if (confirm('确定要直接打印吗?'))  printFlag = true;
        }
        if (printFlag)
        {
            var printWindow = window.open("", "_blank");
            var str = "<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>"
            var s = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n";
            s += "<head>";
            s += "<link href='../css/printTable.css' rel='stylesheet' type='text/css' />";
            s += "<meta http-equiv='Content-Type' content='text/html; charset=GB18030'>";
            s += "</head>";
            s += "<body bgcolor='#ffffff' leftmargin='0' topmargin='0'>";
            s += obj.innerHTML;
            s += "</body>";
            s += "</html>";
            printWindow.document.write(s);
            printWindow.document.close();
            printWindow.document.body.insertAdjacentHTML("beforeEnd", str);
            printWindow.document.all.WebBrowser.ExecWB(p1, p2);
            printWindow.close();

        }
    }

            function printReturn(cho)
            {
                if (cho=="zjgl_grsl")
                  location.replace("../data_search.jsp?ModuleId=<%//=//ModuleId%>&chose=zjgl_grsl");
                else
                  location.replace("lr_slqh.jsp");
            }

    function printStr(div)
    {
        var pwin = window.open("review.jsp?div=" + div, "", 'height=600,width=600,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
        pwin.document.close();
        //这句很重要哦
    }
</script>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics