• 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.

  • 相关阅读:
    java生成验证码
    SpringBoot定时任务
    事务管理
    Windows 2008 Server R2双网卡负载均衡
    HP Proliant DL580 gen9 阵列卡P440AR 高速缓存 被禁用
    Kali Debian 修改时区
    First Py From Py
    C++头文件#include<bits/stdc++.h>
    排序算法
    运算符优先级
  • 原文地址:https://www.cnblogs.com/leolis/p/2366923.html
Copyright © 2020-2023  润新知