Tag Archives: javascript

How to add a print button on a SharePoint List

Reference Link:

http://microsoftechies.com/2013/03/25/print-a-list-item-in-sharepoint-2010/

Steps:

Open a List
Hit the List tab

In the ribbon: Click the Form Web Parts dropdownlist

Form Web Parts

Form Web Parts

Choose “Default Display Form”

At the top of the Page – Insert Tab, Click the Web Part button to add a new Content Editor web part (CEWP). From Categories choose “Media and Content” > “Content Editor” and add it to the main section of the page. Click the “Click here to add content” and then click the HTML button in the Ribbon to bring up the Edit source code window

In the top ribbon under Markup Click on HTML , Select “Edit HTML Source” Option
You will get new window.

In the window add the following code to display a Print Button at the top of the list item window.

<code>
<input onclick=”window.print();return false;” type=”button” value=”Print this Page”/></code>

Ignore any warnings;

Next, hit the Page tab at the top of the page to view the List item. You should see the Print button;

Hit the Print button to print just the list item.