zoukankan      html  css  js  c++  java
  • Javascript实现IE直接打印

    1.页面插入:

    <script language="javascript" type="text/javascript">            
                function preview() {
                    bdhtml = window.document.body.innerHTML;
                    sprnstr = "<!--startprint-->";
                    eprnstr = "<!--endprint-->";
                    prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
                    prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
                    window.document.body.innerHTML = prnhtml;
                    window.print();
                    window.document.body.innerHTML = bdhtml;              
                }
        </script>

    注:打印内容为"<!--startprint-->"..."<!--endprint-->"之间页面内容,所以须将这两个标记插入到<body>标记中间。

    如下代码所示:

    <form id="form1" runat="server">
        <!--startprint-->
        <div style="border:dottted">
            <br />
            Dear
            <asp:Label ID="lb_Name" runat="server"></asp:Label>
        
            ,<br />
            <br />
            With reference to the outstanding invoice,please note that it remains 
            outstanding till today.Kindly advice payment details if payment has been 
            made,otherwise kindly expedite the payment.Attached are the invoice 
            details.Please ensure that payment reaches us
            <div id="byDay" runat="server"></div><br />
            <br />
            <b>If payment is not received within 3 months for SDF funded courses from the 
            completion of the course,we will resend a debit note,reflecting the unclaimed 
            SDF amount for your settlement.<br />
            If payment is not received within 60 Days from Date of Invoice,we will impose a 
            late payment penalty charge of 2% interest per month</b><br />
            <br />
            Should you require furtther clarifications on the said invoice,please do not 
            hesitate to contact Finance Department at 63237911.<br />
            <br />
            Kind Regards,<br />
            Aileen LIEW<br />
            AR &amp; Admin
            <br />
            <br />
        </div>
        <!--endprint-->
        <div style="text-align:center">
            <asp:Button ID="btn_Print" runat="server" Width="60px" Text="Print" OnClientClick="preview()" />
        </div>
        </form>
  • 相关阅读:
    启动ASM 数据库的步骤
    ora15031 DBCA找不到ASM磁盘组
    ORA12514 解决方法
    Rhel Linux 5.1 (32 位)上安装 Oracle ASM数据库 11g 第 1 版
    Oracle ASM for linx as 4 x8664 创建过程
    在安腾AI64 RHEL3 U3服务器上安装ORACLE10G
    ora12528 : message 12528 not found; product=RDBMS ; facility=ora
    linux下启动oracle服务和监听程序
    linux内核升级RPM包安装问题!!!!
    AS4 下安装Oracle 10g(ASM & RAW)
  • 原文地址:https://www.cnblogs.com/captainR/p/2582762.html
Copyright © 2011-2022 走看看