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.

  • 相关阅读:
    90.子类调用父类同名方法总结
    89.子类调用父类同名属性和方法
    88.子类调用父类同名属性和方法
    87.子类重写父类的同名属性和方法
    86.多继承
    85.单继承
    84.继承的概念
    day09
    83.魔法方法__del__()
    82.魔法方法__str__()
  • 原文地址:https://www.cnblogs.com/leolis/p/2366923.html
Copyright © 2011-2022 走看看