Recently I have really wanted to easily print some SharePoint lists, but I always had to open them in Excel, format the columns and then print...this takes time. I looked at Ishai Sagi's solution, but it didn't really do what I wanted...I really wanted the ability to print directly from the browser using a variety of templates. This also coincided with Brent starting a new CodePlex project to easily add functionality to a SharePoint site without having to use features or solutions. Essentially the project provides functionality for people where no binaries or layouts and can be deployed, and so can be can be used by people on shared hosting. I had agreed to work with him on the project and so thought I could combine the two!
How it works
What does it look like
Here are some screen shots from my blog admin site...
In the last screenshot you see the print dialog displaying what is actually going to be printed shown. From here you can choose to print, print preview or change the template...
You can download some sample prints ...
These samples show the pretty basic templates which are included. However they are generated using XSLT and so you can easily create your own by uploading them to the document library.
The functionality is provided as a list template. You need to download the .stp from the CodePlex project site and then upload it as a new List Template...
Once uploaded you can create a new document library using the template...
The template contains all the files required for the feature and once created you should see the templates...
You can now add the following lines to your default.master for your site just above the </body>...
<link rel="stylesheet" href="/PrintTemplates/printwindow.css"/>
Change the 'PrintTemplates' to be the same as the name of your document library.
You should now be able to navigate to any list and print the items.
Currently the two main problems are that I have only tested it with IE7 (no VM with IE6) and I have to use an ActiveX browser object for the print preview. Therefore in order for the print preview to work your site needs to be in the 'Local Intranet' zone, if not you will see the following error...F5 will return you to the list.
Try it out
Brent has created a demonstration of the functionality Sharepoint Templates site.
Visit the SharePoint templates project on CodePlex for more information
You can download the ZIP containing the required files here. These can be placed in any document library or on the file system...as long as you can reference them in the src= of your SCRIPT tag.