zoukankan      html  css  js  c++  java
  • Print List Item With InfoPath Form

    As we all know,if we change display form of a list item to infopath form,there can't find the print preview button on the ribbon:

    If we want to print this form, we need to add a print button,but how to do it,just follow the following steps:

    First,trun back to the list,on the ribbon area,click "List"-"Modify Form Webparts",choose "(Item) Display Form":

    Then,click "Add Webpart" on the page area,select "Media and Content"-"Content Editor Webpart",click "Add":

    Then,modify the content editor webpart,click "Modify Html Code":

    Add the following code:

    View Code
     1 <script src="/_layouts/jquery.min.js" type="text/javascript"></script>
    2 <script src="/_layouts/jquery.PrintArea.js" type="text/javascript"></script>
    3
    4 <script type="text/javascript">
    5 $(document).ready(function () {
    6 $("#print_button").click(function(){
    7 $("#WebPartWPQ2").printArea();
    8 });
    9 });
    10 </script>
    11 <input id="print_button" type="button" value="打 印"/>

    Before we do this,we should add "jquery.min.js" and "jquery.PrintArea.js" to this folder on SharePoint Server:"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\","jquery.PrintArea.js" can be downloaded from the internet.

    "WebPartWPQ2" is the area id we want to print.

  • 相关阅读:
    计算机图形学
    2017.3.20
    史上最强型人养成秘籍: 90 天肥仔变型男实录
    Word 2013发布博客测试
    eeeeeeeeeee
    测试,使用word2013发布博客园博客
    Win7系统桌面便签怎么添加?
    开启两步验证的教程
    【Todo】 cygwin下emacs中M-x shell 中出现乱码
    emacs的LoadPath
  • 原文地址:https://www.cnblogs.com/leolis/p/2366923.html
Copyright © 2011-2022 走看看