SharePoint 2010 Infopath Print Button

thanks to http://arcemise.wordpress.com/2011/02/04/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:
1
2
<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.

Comentarios

Entradas populares de este blog

Guía de herramientas básicas para estudiantes: 31 apps y webs imprescindibles para ayudarte con los estudios

Comando FOR para archivos BAT

How to Fix Failed to Connect a Hyper-V Standalone to Veeam Backup