现在的位置: 首页 > 综合 > 正文

Infopath 2010 打印按钮

2013年06月05日 ⁄ 综合 ⁄ 共 1163字 ⁄ 字号 评论关闭

SharePoint 2010 Infopath Print Button

SharePoint 2010 Infopath Print Button

I received a request to put a print button within a List Item display view so that one could easily print the current item they’re viewing.  After searching for a way to put a print button within the Infopath form itself (and coming up empty), I figured out how to simply add it to the page that displays the form.

 

The end goal

 

Once you have your Infopath form put together and published to a List, go to the List page.

1. Click on the “List” tab under List Tools

2. Click on the drop down arrow on the “Modify Form Webparts” button (pictured)

 

3. Select “(Item) Display Form”

4. This will take you to an edit page screen with your Infopath form set as a webpart

 

5. Add a “Content Editor Webpart” to the page

6. Edit your new webpart’s source and paste in the following:

 

<input type="button" value=" Print this page "
onclick="window.print();return false;" />

 

Note: <form> tags are not required

This adds a print button to the page that uses the default print call within a browser.  Since we edited the “Display” form, the button will not appear if a user is editing the form or creating a new item.

Of course, the best part of this discovery is the added bonus of being able to add extra code to our Infopath forms, making them a much more versatile tool than they were before.

抱歉!评论已关闭.