Print List Item With InfoPath Form

本文介绍如何为已转换为InfoPath形式的SharePoint列表项添加打印按钮。通过在显示表单中插入Content Editor Web Part并加入特定JavaScript代码实现自定义打印功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

转载于:https://www.cnblogs.com/leolis/archive/2012/02/24/2366923.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值