SharePoint – Adding a Print function to the Ribbon

Sometimes it would be nice to have the print icon at hand from the Ribbon or even the List Item dropdown menu.

image

Clicking the icon will bring up the Printer pop-up window.

image

It prints in this case to a PDF file.

image

To accomplish this you need to open the SPDesigner, go to the relevant List. And add a new Custom Action.

image

image

Add this JavaScript code to the button.

javascript:window.print();

Add a nice print ICON rightsMask and Sequence to it and that is it.

image

Adding a list Item Menu is simular, but you need to start for the SPD menu.

image

Make sure you add the icon to the 16×16 Button image URL Location.

image

 

Or you can as well add a print button, attached to a JQuery click event.

image

<td><button class=”printMe” type=”submit”  style=”font-size: x-small; font-family: Verdana; width: 100px; height: 23px;” >Print</button></td>

$(‘.printMe’).click(function() {
  window.print();
  return false;
  });

<script type=”text/javascript”>
$(document).ready(function() {

$(‘.printMe’).click(function() {
  window.print();
  return false;
  });

});
</script>

Enjoy !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: