Easily print SharePoint lists using your own template

Search

Accessible SharePoint WebSites
Download ARF

Easily print SharePoint lists using your own template

http://blog.thekid.me.uk

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!

The plan

The idea I had was to add some menu items to the standard WSS menus using javascript and to do all formatting client side. Obviously I chose XML & XSLT to do this, mainly because the SharePoint web services return XML, but also because it makes creating new templates so easy.

How it works

The javascript adds menu items to both the 'Actions' menu of a list view and also the to drop-down menu of the list items within the view...how this is done I will leave for another post! In response to choosing print a new window is shown, the list is retrieved using web services and then transformed using XSLT. This is shown in a DHTML dialog from which you can print it, print preview it or select a different template. Templates are defined in a document library using XSLT and you can add as many as you like.

What does it look like

Here are some screen shots from my blog admin site...

image image image

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...

image

Samples

You can download some sample prints ...

Item print sample (.xps) 

List print sample (.xps)

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.

Installation

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...

image

Once uploaded you can create a new document library using the template...

image

The template contains all the files required for the feature and once created you should see the templates...

image

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"/>
<script language="javascript" src="/PrintTemplates/printwindow.js"></script>
<script language="javascript" src="/PrintTemplates/PrintFunctions.js"></script>
<script>_tk_enablePrintFunctions("/", "PrintTemplates")</script>   

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.

Problems

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.

image

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.

Posted by Vincent Rothwell on Sunday, 22 Jul 2007 17:14  - 112 Comments
Orininally printed from http://thekid.me.uk - Copyright Vincent Rothwell 2007
 

Comments

Sunday, 27 Jul 2008 10:36 by Thomas
Tom: I am having the same problem. this works falsely on the main site but I can't get it to work in sub-sites. I don't even get the links in the source code. what links do you put in the default.master? anyone can tell me how to make it works for sub-sites I would appreciate! thanks

Sunday, 27 Jul 2008 10:36 by Dave
Successful install on the root site. Added the template doc library to the top level site and another doc library on one of my subsites. Modified the default.master for both sites as well (top level and sub) and the printlist and printitem both work fine. Now I need to learn how to modify the templates to look like I need them too. There are several fields I don't want to see. Also noted that blank fields are omitted from the printout. Works nicely. Thank you; Dave

Sunday, 27 Jul 2008 10:36 by Don
Is there a way to print the header on each page. I think that by default ,it prints the header only on first page.

Sunday, 27 Jul 2008 10:36 by rjc
Hi I have this working, but I'm really struggling trying to create some extra XSl templates, for example pulling in just certain rows from a list for example 'Title', 'Date'. Any advice or links to tutorials would be greatly appreciated. Thanks

Sunday, 27 Jul 2008 10:36 by rjc
Hi I have this working, but I'm really struggling trying to create some extra XSl templates, for example pulling in just certain rows from a list for example 'Title', 'Date'. Any advice or links to tutorials would be greatly appreciated. Thanks

Sunday, 27 Jul 2008 10:36 by Vince
Don, Sorry, not that I know of. RJC, The print works on the current view of the list. Therefore you need to add all the column you require to the view. To see the XML, its best to use Fiddler (www.fiddlertool.com) to see the XML returned from SharePoint. --Vince

Sunday, 27 Jul 2008 10:36 by Mac
Vince, Check out this printing tool.. www.sharepointprinting.com You can use it to print document libraries as well as list items without any coding. Also you can print documents without opening them. Cheers, Mac

Sunday, 27 Jul 2008 10:36 by Matthias Hummel
Hi, I tried out your beautiful ListPrintTemplate. I have running a german MOSS2007. After I uploaded the ListPrintTemplates.stp in my Listtemplate Gallery, nothing happened. I can't create a List based on this Template (there is no entry called "List Print Template" or something like that). Is this version only for english MOSS2007? Can you help me? Thanks a lot! Matze

Sunday, 27 Jul 2008 10:36 by Vince
Matze, It was produced on an english site, I'm not sure if there would be problems using it on a site using a different language...I wouldn't have thought so. The template is for a 'Document Libary' and so it should appear on the left side of the 'Create' page. Realistically you can create your own documnet library and place the files in there. The template is just there to easily place the required files in the library. Let me know and if you still can;t find the template I'll provide a link to a zip with all the .js and .xsl files required. Vince

Sunday, 27 Jul 2008 10:36 by JonnyM
Hi Vince, Great add-on. worked ootb. Print item does not appear for fba users but i'll see if there's a workaround and update you on that. Also, is there a way of displaying only the filtered items on the list? thanks Jonny

Sunday, 27 Jul 2008 10:36 by Vince
Jonny, I thought that it used the current view as the source? I must admit I haven't look at this for some time and so can't really remember the details. You could change the XSL to do the filtering and have different templates? Vince

Sunday, 27 Jul 2008 10:36 by Matthias Hummel
Hi Vince, Unfortunately I still can't find the template. Can you send me the zip file, or the link to the file? I hope I get this very nice feature. Thanks! Matze

Sunday, 27 Jul 2008 10:36 by Vince
Matze, I have added a link to a ZIP containing all the required files. Vince

Sunday, 27 Jul 2008 10:36 by Matthias Hummel
Hi Vince, thanks for the files. I have uploaded the files and added my default.master about the following code: <link rel="stylesheet" href="http://srv-home/SiteCollectionDocuments/SharePointListPrint/printwindow.css"/> <script language="javascript" src="http://srv-home/SiteCollectionDocuments/SharePointListPrint/printwindow.js"></script> <script language="javascript" src="http://srv-home/SiteCollectionDocuments/SharePointListPrint/printfunctions.js"></script> <script>_tk_enablePrintFunctions("/", "SiteCollectionDocuments")</script> The files are in the SiteCollectionDocuments, in a folder and the two templates "defaultitemprint" and "defaultlistprint" are in the SiteCollectionDocuments too. For example I want to print the SiteCollectionDocuments. I click on the Print List menu-button and the window is coming up. But there is nothing in...I have the same problem if I want to print a normal list. And when I want to print only an item, i saw that there is no entry like "print item"... I hope you can help me. I absolute need this function. Thanks, Matze

Sunday, 27 Jul 2008 10:36 by Sammy
Everyone, We recently purchased a software (Unbounded Printing Services for SharePoint) that has really simplified our printing from MOSS. Check out the site for more details www.SharePointPrinting.com. Take Care.

Sunday, 27 Jul 2008 10:36 by Ludovic
Hi, I have tested it, and the Print List feat seems to work almost perfectly... there's still 2 things that I can't make it work : 1) having only 1 PrintTemplates lib on "/" ; basically you have to add another PrintTemplates for each subsites (prolly because the location is "relative" to the current site ?) 2) as Matze pointed out, is "Print Item" supposed to appear in the context menu ? Thanks, Ludovic

Sunday, 27 Jul 2008 10:36 by Jordan
Vince, I am a little confused as to what to place in the href, src, & the first param of _tk_enablePrintFunctions. Am I place the whole url from my SharePoint site or what, it seems like there are two different explanations, there is this one on this site: "Change the 'PrintTemplates' to be the same as the name of your document library." & this one on a connecting site: "Make sure the first parameter of _tk_enablePrintFunctions points to the location of PrintTemplates list." I just need some clarity on how to correctly place the code in the default.master.

Sunday, 27 Jul 2008 10:36 by Matthias Hummel
Hi Ludovic, do you have an english or german moss? What do you mean with "another PrintTemplate"? I have added the two PrintTemplate above. Isn't that enough? The courius thing is, that no items were shown when i click on "print list". Thanks, Matze

Sunday, 27 Jul 2008 10:36 by Vincent
Firstly sorry for taking time to get back to you...I put my back out and have tried to steer clear of computers!! Matze, It looks like you have put the files into a sub folder?? Not sure that will work. You are probably best to create a document library specifically for the file in the ZIP. The _tk_enablePrintFunctions() then takes the path to the document library ("/") and the name of the document library ("PrintTemplates"). Can you use fiddler (www.fiddlertool.com) to see what files are being loaded and if there are any 404s. If the files are being loaded & called correctly Fiddler will help to see if the WebServices are being called successfully and the XSLT is being loaded. If you are still having problems email me the Fiddler trace (vince _at_ thekid.me.uk) and I will have a look. Ludovic, It is a problem as the feature was initially envisaged as a solution for a site owner who cannot install DLLs on the server. It was something I wanted to look at for the next release. If your JavaScript is any good you maybe able to work it out. The Print Item should appear...it does for me. One of the things I need to add is better error handling. One of the problems I found in testing was timimg. Adding the "Print Item..." depends on CORE.js being loaded. There is a function which replaces one of the functions in CORE.js (Custom_AddListMenuItems) and it uses setTimeout() to wait until it is loaded. I can only assume there is a problem there? If you can attach a debugger to trace the JavaScript that would be really good.

Sunday, 27 Jul 2008 10:36 by Ludovic
@Matze: I have a French MOSS actually :) By "another PrintTemplate", I meant a Print Template Library. As previously said, it only seems to work on lists of the same site level. In case of sub-sites, I had to create another Print Template Library, or I get a blank list. @Vincent: Well I'm not too familiar with JavaScript but I'll give a try if I have the time :) Concerning the "Print Item", what is it supposed to do by the way ? have a neater view of an item Display Form ? One last thing, it looks like there's an issue with Form Based Authentication (=> blank list), but it's yet to be determined. Ludovic

Sunday, 27 Jul 2008 10:36 by Vincent
Ludovic, I haven't tried Forms Auth, but I can't see why there should be a difference (maybe the client side XSLT transform?). The idea is that the Print List will give you the XML of the current list view and the print item will give you the XML of the current item. This way you can create a nice view of a list item, maybe format a task so that it is easier to read and has space for notes when you print it out? I hope to provide some good XSLT for specific examples...when I get time!! Vince

Sunday, 27 Jul 2008 10:36 by Ludovic
Vincent, You're right about about both : - the "Print Item" which does appear, but not for Libs nor certain lists (like custom ?) ; do you have an idea on why ? - the FBA wasn't in cause, it was all a matter of permission where you need at least a "contribute" level (eg: Site Members) Ludovic

Sunday, 27 Jul 2008 10:36 by Sammy_NoMore
This guy says he purchased a software called Unbounded Printing Services for SharePoint and yet gives his url as the one who sells the software. Can you guys see the spam here?

Sunday, 27 Jul 2008 10:36 by Patrick
Hi Vince, Thanks for this really beautifull Print-Addon. But I got some problems with the list items template. There are just fields shown with "Required" (List settings) enabled. Could you please make an example where I could change these settings? Thanks alot...

Sunday, 27 Jul 2008 10:36 by Oksic
After install the template, only have the MENU ACTION option, and the preview show a blank page. ITEM option doens't appear. Do you think could be the path defined on masterpage? tnkx

Sunday, 27 Jul 2008 10:36 by Vince
It could well be the path. Try using Fiddler (www.fiddlertool.com) to make sure that all the .js files are found and that the WebService calls are working correctly.

Sunday, 27 Jul 2008 10:36 by Vince
Patrick, The fields should be the fields of the current view. You would need to create a new view to get more fields. Sammy, Its a bit naff, I would have preffered them to be honest, but at least it is releavent to the post. I may help someone so I thought I'll leave it. --Vince

Sunday, 27 Jul 2008 10:36 by Patrick
Vince, It worked - thanks alot ;)

Sunday, 27 Jul 2008 10:36 by Tom
Will this work for only one list in a site? The instructions say to map a path (in default.master) to the exact URL to the doc library you want to enable printing on. Since it is in the default.master, does that mean only one list is your site can be enabled for printing (i.e. the list you map in the tk_enablePrintFunctions function in the default.master?)

Sunday, 27 Jul 2008 10:36 by Vince
No this will work for all lists and document libraries in a site. The .js files are kept in a document library (.stp) for ease of install. They can be anywhere. You need to ensure the path you use when you reference the .js files point to the location of your .js files. When you initialise the functionality (_tk_enablePrintFunctions()) you pass it the name of the library where the XSL is stored so that the XML can be transformed client side. Placing the <script> tags in the master page will make the functionality available to all lists in a site. HTH, Vince

Sunday, 27 Jul 2008 10:36 by Eric
Hi, I implement the add-on and it work just fine, it is a great option to have in SharePoint. Now I would like to know if when I click on a list item to see it on a single page to make the print button available on the page beside the button "New Item Edit Item Delete Item Alert Me...." That would be nice to be able to print a single item from the list. Thanks Eric

Sunday, 27 Jul 2008 10:37 by Geoffrey
I am not getting anything as well. 1. I uploaded the List template 2. I created the document library on the main site using the List Template, even called it "PrintTemplates" 3. Copied the code into the default.master file right above </BODY> I am not getting any of the print menu selections. Can anyone see what I did wrong?

Sunday, 27 Jul 2008 10:37 by Geoffrey
I am not getting anything as well. 1. I uploaded the List template 2. I created the document library on the main site using the List Template, even called it "PrintTemplates" 3. Copied the code into the default.master file right above </BODY> I am not getting any of the print menu selections. Can anyone see what I did wrong?

Sunday, 27 Jul 2008 10:37 by Tom
Geoffrey - Can you post your js here? I had the same problem (blank page) but once I get the paths squared away, it started working.

Sunday, 27 Jul 2008 10:37 by Geoffrey
Nevermind, I got it to work. I was working out of the wrong default.master!

Sunday, 27 Jul 2008 10:37 by Vince
Geoffrey, Glad to here you got it working. Sorry I didn't get back to you sooner, but I had been trying to find some time to look at the project in order to give you some more suggestions. - Vince

Sunday, 27 Jul 2008 10:37 by Lars
Hi Vince, it works fine, also in german, thanks. But I have Problem in SubWeb. Fiddler reports, that the WebService can't find List "PrintTemplates". Do I Have to create in each SubWeb a DocLib? thx for help

Sunday, 27 Jul 2008 10:37 by Rich
Hi I've tried making changes to the defaultprintlist.xsl template but nothing actually changes on the site. I've even just tried changing the silver highlight in the Highlighted List template to red, but that's not picked up either. I've tried clearing my cache, restarting Sharepoint completely, but still no joy. I've also tried taking a copy of one of the templates and giving it a different title. This new template appears in the drop-down list but when you select it the display of what will be printed is blank (even though it's an unchanged copy of the original. Any help will be much appreciated! Rich

Sunday, 27 Jul 2008 10:37 by Michael
Hi Vince, at first: GREAT WORK!!! Now the bad news ;) ... I made it to get the PrintList action running, but the PrintItem does not appear. I'm using WSS 3.0 German Edition. Path to my Website: http://filesrv/sptut/ CSS & JS-Code: <link rel="stylesheet" href="/sptut/PrintTemplates/printwindow.css"/> <script language="javascript" src="/sptut/PrintTemplates/printwindow.js"></script> <script language="javascript" src="/sptut/PrintTemplates/printfunctions.js"></script> <script>_tk_enablePrintFunctions("/sptut/", "PrintTemplates/")</script> Fiddler doesn't point out any problems or errors No JS errors in IE7 I hope you're able to help me

Sunday, 27 Jul 2008 10:37 by Abel Garcia
I would like to show the print button in the wiki pages so you can print the content of the wiki and nothing else. Could you tell me how to do it?

Sunday, 27 Jul 2008 10:37 by Vince
Abel, Not sure this technique would be best for that. I would suggest using a print stylesheet which removes all the navigation and chrome from the page, leaving just the Wiki content. --Vince

Sunday, 27 Jul 2008 10:37 by Richard Black
I can't get this to work on my MOSS2007 server. Is that because the MOSS menus are slightly different, or should it work on MOSS? R.

Sunday, 27 Jul 2008 10:37 by Gilles Sylvestre
Hi Vince, finaly, a long awaited solution to a basic requirement(print). Thank you for your dedication to the community. Vince, I have some questions. 1. How can I get it work on a different language (French)? As you know, any template (List or Site) produced on a certain language environnement can not be used in a different language environnement. I would be happy to contribute to the project if you send me the necessary material and instructions (guidelines). 2. If if understood correctly, it is working only with document libraries. Is it possible to make it work on any type of list? Again, I am ready to contribute to that issue. 3. How can I inject the fonctionnality in an existant list (some of my list already contains thousand of items)? 4. Wow can I define and implement my own xslt's? 5. Is it possible to define more than one template for the same list an have the user choose form a list of templates? Again, I am ready to contribute to that issue. Warm regards Gilles

Sunday, 27 Jul 2008 10:37 by Vince
Gilles, 1. The list template is only there to make adding the required JavaScript and XSLTs to the site...they can actually live in any document library. You can create your own doclib and copy them to it. 2. It should work with both lists and document libraries. If you include the JavaScript in your default.master the new menu items should appear for any list. 3. It will work with all lists even if they already exist. 4. Just take a copy of an existing XSLT and modify it to suit your needs. To get the XML its best to use Fiddler to get the response to one of the WebService calls. 5. There is a list of the available templates in the dialog...top right corner. Any XSLTs in the document library associated with that type (ListItem or List) should appear there. If you have any issues Fiddler (www.fiddlertool.com) is the best help. You can make sure the JS is loaded and that the WS call are executing correctly. HTH, Vince

Sunday, 27 Jul 2008 10:37 by Vince
Richard, This should work for both WSS and MOSS.

Sunday, 27 Jul 2008 10:37 by talamar
Works perfect! Just the thing for which I was looking!

Sunday, 27 Jul 2008 10:37 by Rob
Vince I am trying my best to implement your mod, but without any luck. I can get the 'print list' item to show up in the action list, but when clicked i get a blank window with no data. Item option also does not show up. I used fiddler, and nothing appears to go wrong, but when comparing the fiddler trace from my site to your example site, the traces are quite different. The first item in the trace from your site (sites/demos/print/_vti_bin/lists.amx) is the LAST item in my trace. Any ideas? Thanks in advance, Rob

Sunday, 27 Jul 2008 10:37 by Tom
Does "anyone" know how to correct the code so it works on a site collection with several sites, but only one PrintTemplates library off the root? what I got: PrintTemplates on root of site, links in default.master updated & entered. Confirmed that default.master lines are in sub-sites (view source in IE)... but 'Actions > Print List...' opens but doesn't populate data & 'Print Item...' doesn't show on context menu; EXCEPT on the root site. If I add the doc lib to each site, it works, but i can't figure out how to reference the single 'root' location of the template files. this is killing me... anyone?

Sunday, 27 Jul 2008 10:37 by Kevin
I was able to deploy the solution with no issues but is there anyway to format the list so that it will print on one page?

Sunday, 27 Jul 2008 10:37 by Michael G
Works great in IE 7. Works in IE6 too but every time I browse to a page it pops up with the "Print List" box (it appears as soon the page loads) and with a security Information box - "This page contains both secure and non secure items". No you want to display the non secure items? Once I select YES or NO to the security information box the print list disappears. It's a secure site. I've added the site into trusted sites and intranet both made no difference. Any suggestions?! Keven - Select print preview - shrink to fit. Then select to print in landscape.

Sunday, 27 Jul 2008 10:37 by Nir
Hello Vince I installed as instructed but: A. print list menu action appears but when i'm pressing it only blank page is loaded without the list content, even when I'm doing so in the same root site where the PrintTemplates doc lib is B. the print item action doesn't appear at all Thanks Nir

Sunday, 27 Jul 2008 10:37 by ThiNg
Vince, I have the same issues as Nir. 1. I can see the Print List item in the Actions menu but clicking it loads an empty dialog box (I can see the Title: Print List and the printer and preview icons in the title bar). 2. I do not get the print item action. I think it has to do with the path and list name. The path to get to my PrintTemplates folder is: http://SharePointSite/PrintTemplates1/Forms/Templates.aspx (I have no idea why it labelled it PrintTemplates1 - I can only assume I had another one there from before?) My code on the default.master reads: <link rel="stylesheet" href="/PrintTemplates1/printwindow.css"/> <script language="javascript" src="/PrintTemplates1/printwindow.js"></script> <script language="javascript" src="/PrintTemplates1/printfunctions.js"></script> <script>_tk_enablePrintFunctions("/", "PrintTemplates1")</script> i thinks the last line is the main problem. I read your instructions and the ones on the SharePoint Templates 15 times so I think I am missing something major... I would appreciate any help ASAP as this would really save my bacon!! Thanks in advance. ================================== I ran the Fiddler and it tells me the following: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</soap:Text></soap:Reason><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/"> List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user. </errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode></detail></soap:Fault></soap:Body></soap:Envelope> ==================================== <?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>PrintTemplates1</listName><webID>{4077ADC7-CB6C-40DA-BFCC-091748628B3E}</webID></GetListItems></soap12:Body></soap12:Envelope> =====================================

Sunday, 27 Jul 2008 10:37 by Pat
EXCELLENT WORK!! I applied the template to our site and it works nice. Is there anyway to format the list that it prints? It prints the date and time as following for Date-Only column: 2008-02-22 00:00:00. For the column that gets people from the Active directory, it appends 54;# before the person's name. Any suggestions? Thanks a lot...

Sunday, 27 Jul 2008 10:37 by Nir
Hey Vince, any news about my post and the post of ThiNg above (posted 13-14 of Feb)? thanks in advanced Nir

Wednesday, 30 Jul 2008 09:12 by Katy
Great solution!! I have sucessfully implemented the template for my main site. I had to edit our master (ourcompany.master), and not default.master. My problem is that "ourcompany.master" is not listed under master pages for all my subsites. default.master is listed under these subsites, but when I add the code here I get nothing. It seems all the subsites pull from ourcompany.master. But I can't get the print option in my subsites. (I've added a PrintTemplates library to the subsites in the process also.) Does anyone know more about this than I do?

Thursday, 21 Aug 2008 03:30 by Lee
Guys....REALLY???!!! Why are you wasting your time trying to "figure it out" when for only 1695 you can purchase a out of box solution that allows printing of SharePoint Documents, List Items & Attachments, Calendar Events & Views, Reports, Discussion Threads, Wiki Pages, Key Performance Indicators, etc. There is even a 8 minute On-Demand Video!! Guys...let's not reinvent the wheel. This is why development costs are through the roof for companies, becuase there are too many people that spend toom uch time and money developing solutions that are already developed! Sorry for the rant....and YES I do work for www.sharepointprinting.com Lee

Tuesday, 16 Sep 2008 03:39 by Quen
Dear Vince, Please Help. The print list menu action appears but when i press it,it only loads a blank page.I'm doing it in the same root site where the PrintTemplates doc lib is and where the default.master is edited. Thnx in advance, Quen

Tuesday, 16 Sep 2008 04:57 by Quen
my code: <link rel="stylesheet" href="https://sharepoint2007/sites/quentincelie/PrintTemplates/printwindow.css"/> <script language="javascript" src="https://sharepoint2007/sites/quentincelie/PrintTemplates/printwindow.js"></script> <script language="javascript" src="https://sharepoint2007/sites/quentincelie/PrintTemplates/printfunctions.js"></script> <script>_tk_enablePrintFunctions("/", "PrintTemplates")</script>

Thursday, 23 Oct 2008 09:48 by Kundan Ghimire
Works Great . is there a way to print the document same as the list from the document library without opeb=ning the document As well if I go to the sub folder on my document library and do rint list it hows me the main Shared document folder. I can not see the sub folder. Any suggestions

Tuesday, 28 Oct 2008 04:36 by naemi
hi:-) works very good! but not for my self-building lists. :( i have a list, it reads from mydatabase. if i try to print it, i have a blank-site.:-( cay you help me please? thanx! naemi

Tuesday, 28 Oct 2008 05:33 by naemi
hi:-) works very good! but not for my self-building lists. :( i have a list, it reads from mydatabase. if i try to print it, i have a blank-site.:-( cay you help me please? thanx! naemi

Saturday, 1 Nov 2008 03:36 by fokrtaisk
works very good! Thnx in advance

Monday, 3 Nov 2008 11:55 by Felipe
Works Great!!! i have a problem printing a list item, the Title of the field apears with strange codes, like this: _x00200_ or _x00e7_ any ideas?? --- thanks in advance Felipe.

Thursday, 6 Nov 2008 11:23 by Michael Corcoran
I like this tool, and sorry www.sharepointprinting.com, I don't want to pay $5K plus for what can be accomplished, in part, with free tools like this - bamboosolutions.com has a comparable tool for $500. And I don't work for either! I found that it worked fine for printing lists in my root site, but got the problem of the blank preview page when printing from any root site, even ones with the same permission as the root. Once I created a library in the root of the sub-site from the "List Print Templates" template, calling it PrintTemplates, the correct documents get entered into the subsite and printing works as advertised. Thanks!

Thursday, 20 Nov 2008 02:29 by Ryan
I have exactly the same issue as a lot of other people whereby it will not work in sub-sites unless I also put the PrintTemplates folder in the root of each sub-site. Has anyone actually gotten to the bottom of this issue because it seems stupid to have these folders duplicated everywhere through SharePoint just to get this to work. Vince a lot of people have this problem, do you have a fix?

Friday, 21 Nov 2008 02:25 by Mark
Just came across this solution and it's AMAZING! Got it to work great with lists, although I wish MSXML supported regular expressions! However, the item printing does not seem as robust. in addition to display issues (which I can easily fix), I have noticed that only a small number of the fields in my list item are displayed. Do you know if there is a different CAML query or web services call you could use to get more data. and I'm talking about fields that have data in them, not blank fields.

Friday, 21 Nov 2008 02:49 by Mark
Just came across this solution and it's AMAZING! Got it to work great with lists, although I wish MSXML supported regular expressions! However, the item printing does not seem as robust. in addition to display issues (which I can easily fix), I have noticed that only a small number of the fields in my list item are displayed. Do you know if there is a different CAML query or web services call you could use to get more data. and I'm talking about fields that have data in them, not blank fields.

Thursday, 18 Dec 2008 07:18 by pret
I just came across this article it works great. But I found it difficult to display all column of any list, since it display only column available in view. I was also trying to filter unwanted column.

Tuesday, 30 Dec 2008 03:22 by Ashish
Hello I am redirecting from asp.net application to MOSS (FBA), it gives me following error MIcrosoft Jscript run time error: object expected in following line _tk_enablePrintFunctions("/sites/demos/print/", "PrintTemplates") Can you please tell me how to resolve this?

Tuesday, 6 Jan 2009 01:47 by Bill Bialas
I'm a Noob on this stuff. But I was looking at the XSL for the Item print. Is there a way to select fields other than what has been populated in the data set by '#RowsetSchema'. If not is there a way to modify the schema to include the sharepoint list items I want to see on the print out?? I.e. For a contact list I want to see the FULL NAME, as the example sits now this does not display. Again this would be for the Item level printing... Thanks Bill

Tuesday, 6 Jan 2009 02:18 by Bill Bialas
I'm a Noob on this stuff. But I was looking at the XSL for the Item print. Is there a way to select fields other than what has been populated in the data set by '#RowsetSchema'. If not is there a way to modify the schema to include the sharepoint list items I want to see on the print out?? I.e. For a contact list I want to see the FULL NAME, as the example sits now this does not display. Again this would be for the Item level printing... Thanks Bill

Tuesday, 13 Jan 2009 06:40 by nollkoll
as an alternative for users who dont like custom stuff of any sort. for users of office 2007 i can recommend opening your sharepoint lists in access2007 (action menu and open in access). use the link sharepoint list option and use the access report engine to design all the reports you need to print. save the db on a fileshare and all users can get to it and print the same reports. just a thought ...

Thursday, 22 Jan 2009 11:45 by Chuck Stableford
Aloha, Deployed your scripts, and modified the master page without any issue. I can "see" the Print List in the Action but nothing comes up i the window, even though the list is populated with entries... any thoughts?

Tuesday, 10 Feb 2009 04:04 by Angelo
Hi, I'm also having trouble when clicking 'Print List' in the Action menu. The window that pops up stays blank. Also not getting the 'Print Item' -option. Is there still no sollution for this issue? I'm using a Dutch version of MOSS.

Sunday, 1 Mar 2009 11:43 by GreenLife
Hi Vince - What is your recommended way to deploy farm wide (SiteCollection and Portal) with minimal copies of the PrintTemplates library? Every sub-site needs a copy!!

Thursday, 12 Mar 2009 05:16 by James Bruiners
Hi Guys, If you are not wanting to edit the master page using a content editor webpart to load the Javascript ref's. It isnt the best solution becuase you will have to load a CEWP to every list.aspx page. You could also create a list template yourself that will add this CEWP to the page. For a similar example look at how you implement lytebox with sharepoint! Using this method means you dont have to edit the master page for each site collection also, just reference the relative path (\layouts\.....). Although i am having an interesting problem the print functionality drop to the bottom of the page when i use it? Anyone come up on this, cant see any reason in the XSLT...? Thanks James

Monday, 16 Mar 2009 03:10 by Saed Tuffaha
Great Work, my boss asked me for this, and here i am... again like others it shows but when i print empty page shows... i am sure it has to do with path my code from "View Source" is </style></HEAD> <link rel="stylesheet" href="/personal/tuffahsa/Print/printwindow.css"/> <script language="javascript" src="/personal/tuffahsa/Print/printwindow.js"></script> <script language="javascript" src="/personal/tuffahsa/Print/PrintFunctions.js"></script> <script> _tk_enablePrintFunctions("/personal/tuffahsa/", "Print")</script> please can you help me

Monday, 16 Mar 2009 04:18 by Saed Tuffaha
Great Work, my boss asked me for this, and here i am... again like others it shows but when i print empty page shows... i am sure it has to do with path my code from "View Source" is </style></HEAD> <link rel="stylesheet" href="/personal/tuffahsa/Print/printwindow.css"/> <script language="javascript" src="/personal/tuffahsa/Print/printwindow.js"></script> <script language="javascript" src="/personal/tuffahsa/Print/PrintFunctions.js"></script> <script> _tk_enablePrintFunctions("/personal/tuffahsa/", "Print")</script> please can you help me

Monday, 23 Mar 2009 01:40 by Hari
Hi This works great for me. but the problem i am having is - if i went to another computer and login as a different user then the print list option does not show up in the actions menu. i will greatly appreciate any help and can somebody tell me whi is this happening. I am running MOSS 2007 and intranet. Thanks Hari

Monday, 23 Mar 2009 02:49 by Hari
Hi This works great for me. but the problem i am having is - if i went to another computer and login as a different user then the print list option does not show up in the actions menu. i will greatly appreciate any help and can somebody tell me whi is this happening. I am running MOSS 2007 and intranet. Thanks Hari

Saturday, 28 Mar 2009 10:55 by Daniel
Hi, I had the same problems with the blank print window and the missing print item button. After 2 hours code reading and testing and testing i found the solution ... it's very simple! If you created a new Document Libary and uploaded the files there, you have to add one new column! This column should be named "TemplateType" After that you have to change the File Settings: Filename Title TemplateType defaultItemPrint Default Item defaultListPrint Default List highlightedList highlightedList List common Common Style Utility Hope this can solve your problems! For me this works perfect!

Tuesday, 31 Mar 2009 03:19 by Angelo
Thanks Daniel! Your solution worked just fine for me!

Monday, 6 Apr 2009 04:16 by hotguy
Thanks great work. Ever one seems to have a very common problem it shows blank page when the print button is click. I encounter the same issue. What I end up doing is create a folder under _catalogs folder and named it PrintTemplates using SP Designer. Copy all the file form PrintTemplates libray to this folder. Add the following lines to default.master, as mentioned before. <link rel="stylesheet" href="http://Severname/SiteCollection/_catalogs/PrintTemplates/printwindow.css"/> <script language="javascript" src=" http://Severname/SiteCollection /_catalogs/PrintTemplates/printwindow.js"></script> <script language="javascript" src=" http://Severname/SiteCollection /_catalogs/PrintTemplates/PrintFunctions.js"></script> <script>_tk_enablePrintFunctions("http://Severname/SiteCollection /_catalogs/","PrintTemplates")</script> Now I would not have to create a separate mater pages for each Site but still need to create a Document Library using the Print list template on every site. I thing because of the links with in the files are not relative its only look for the files with in the sites or something but it works great now.

Monday, 11 May 2009 05:59 by Sinisa
First of all, thanks for this article and template. How can i add a "Print Item Versions" custom menu action item? Can you suggest anything? Regards.

Wednesday, 20 May 2009 10:13 by Greg
Lee - Really??!! I think the main reason people spend time coming up with their own solution, instead of relying on a company to develop one for them is simply cost. This one is free, your's costs thousands of dollars. Pretty simple really.

Wednesday, 20 May 2009 12:04 by Greg
Lee - Really??!! I think the main reason people spend time coming up with their own solution, instead of relying on a company to develop one for them is simply cost. This one is free, your's costs thousands of dollars. Pretty simple really.

Tuesday, 26 May 2009 11:22 by Stang
Daniel, I am trying to get the print item menu showing up and have followed your idea of adding a TemplateType column to the library. But I do not understand the changes to the File Settings that you mention. Can you clarify for me please. Thanks.

Tuesday, 26 May 2009 01:31 by Daniel
Hi Stang, if you created the new column you have to edit the listed files in the libary and fill the new Field "TemplateType" with the values shown above. The Picture (http://blog.thekid.me.uk/Media/WindowsLiveWriter/EasilyprintSharePointlistsusingyourownte_14606/image_thumb_7.png) shows you the filelist of the library grouped by the new field TemplateType. Hope this will help you! Regards

Monday, 8 Jun 2009 09:38 by aobial
this is what im looking for. Great stuff. Just one question... How can i remove those columns that i dont want to include in the item that im going to print like that UniqueId, FSObjType, FileLeafRef, etc. aobial

Monday, 8 Jun 2009 10:01 by aobial
this is what im looking for. Great stuff. Just one question... How can i remove those columns that i dont want to include in the item that im going to print like that UniqueId, FSObjType, FileLeafRef, etc. aobial

Monday, 8 Jun 2009 06:36 by Michael
Great job Vince! I got it working, but I had a question about an alternative usage for this. I want to be able to pop up the print window for a certain list, but I don't want the link to be part of a toolbar. I will have to remove the toolbar from the list's view so as to skin it to make it look nicer. Is there a way to call the print popup from a link added to the list through XSLT or from a link added to the page via a CEWP or somesuch? Any ideas how to implement such a solution? Thanks in advance, Michael

Tuesday, 9 Jun 2009 02:40 by Thomas
Exactly what i was looking for. Just one thing: I don't want information (columns) like "MetaInfo", "_Level", "ID", "Created" to be printed when using the Print Item function. How can i remove them?

Tuesday, 9 Jun 2009 03:12 by Thomas
Exactly what i was looking for. Just one thing: I don't want information (columns) like "MetaInfo", "_Level", "ID", "Created" to be printed when using the Print Item function. How can i remove them?

Tuesday, 9 Jun 2009 04:54 by Thomas
Exactly what i was looking for. Just one thing: I don't want information (columns) like "MetaInfo", "_Level", "ID", "Created" to be printed when using the Print Item function. How can i remove them?

Tuesday, 9 Jun 2009 06:05 by Thomas
Exactly what i was looking for. Just one thing: I don't want information (columns) like "MetaInfo", "_Level", "ID", "Created" to be printed when using the Print Item function. How can i remove them?

Monday, 15 Jun 2009 12:51 by Vivian
It's Great! But how can I print the lookup type field not like "1;#xxxxx"?

Tuesday, 16 Jun 2009 06:49 by Thomas
Changes made in say defaultItemPrint.xsl aren't visible when chosing [Print item...]. Is there a file i need to "touch" making sure the stylesheet is being read again?

Thursday, 25 Jun 2009 01:39 by Vivian
Hi Vencent, In addition to site owner how to make all the other people can use this function? Thank you & Best Regards! Vivian

Wednesday, 8 Jul 2009 01:06 by Vivi
Hi, I was looking for something like this ..thanx for that. Firstly let me tell you that m new to sharepoint...! I want to print a list item which is working fine when i go through the list directly,m using wss 3.0 My concern is, i have added the same list to a webpart and now when i try to select the list item for print it doesn't work gives me a javascript error and the browser is closed.

Thursday, 23 Jul 2009 11:38 by J. Daly
Was anyone able to come up with a solution to the problem below? Woudl greatly aprpeciate any assistance, have been working on this for hours! Thanks. ________________________________________________ I applied the template to our site and it works nice. Is there anyway to format the list that it prints? It prints the date and time as following for Date-Only column: 2008-02-22 00:00:00. For the column that gets people from the Active directory, it appends 54;# before the person's name. Any suggestions?

Thursday, 10 Sep 2009 12:39 by vikpri
Hi, Thanks for the wonderful post. "The javascript adds menu items to both the 'Actions' menu of a list view and also the to drop-down menu of the list items within the view...how this is done I will leave for another post!" Can you please provide me the post where you had provided the details of adding Menu item in "Actions" menu.Urgently require it..else can you please provide the code. Thanks much

Thursday, 10 Sep 2009 01:33 by vikpri
Hi, Thanks for the wonderful post. "The javascript adds menu items to both the 'Actions' menu of a list view and also the to drop-down menu of the list items within the view...how this is done I will leave for another post!" Can you please provide me the post where you had provided the details of adding Menu item in "Actions" menu.Urgently require it..else can you please provide the code. Thanks much

Friday, 11 Sep 2009 07:04 by vikpri
Hi, Thanks for the wonderful post. "The javascript adds menu items to both the 'Actions' menu of a list view and also the to drop-down menu of the list items within the view...how this is done I will leave for another post!" Can you please provide me the post where you had provided the details of adding Menu item in "Actions" menu.Urgently require it..else can you please provide the code. Thanks much

Tuesday, 15 Sep 2009 10:03 by Michael Hofer
Great work. Just a hint: please point out that the templates' list name must be identical to the URL, otherwise you'll get into trouble ;)

Wednesday, 16 Sep 2009 11:17 by Lake
Thanks for the wonderful post. I installed the .stp. I have the following two problems: 1) The "Print List" shows in Action menu. The "Print Item" doesn't show in dropdown ECB menu in a document library item, but shows in a custom list item. 2) "Print List" only list items in the root folder of a document library, bue can't print a subfolder items? When upload files into a document library, items "TemplateType" should be item or utility? Please help!!!

Wednesday, 16 Sep 2009 02:18 by Lake
Thanks for the wonderful post. I installed the .stp. I have the following two problems: 1) The "Print List" shows in Action menu. The "Print Item" doesn't show in dropdown ECB menu in a document library item, only shows in a custom list item. 2) "Print List" only print items in the root folder of a document library, but can't print a subfolder items? Please help!!!

Monday, 16 Nov 2009 10:38 by Renee Jack B. Dumanhug
Hi Vince, I followed the instructions w/o any error but I did not get the expected results. The samples above seems like the expected result of what required on me. The "Print List" and "Print Item" actions are not displaying when I opened a list. The "Print Dialog" is not displaying as well. Is there any instructions that I missed? Thanks. Jack

Friday, 20 Nov 2009 03:01 by davetiyeci
düğün davetiyesi.com

Wednesday, 3 Feb 2010 07:29 by mehrdad
has anyone tried this on SBS2008? i must have the path wrong in the default.master edits. nothing chages for me but then SBS2008 WSS3.0 runs on port 987. can anyone please let me know what the default.master edits need to look like?

Thursday, 4 Feb 2010 11:46 by Cameron
Here is how to add headers to each page. (tested with IE 7). 1) Wrap the headers XSL in a thead block (defaultListPrint.xsl) <thead> <tr> <xsl:for-each select="/List/ListAndView/View/ViewFields/FieldRef"> <xsl:variable name="fieldRefName" select="@Name"/> <xsl:variable name="field" select="/List/ListAndView/List/Fields/Field[@Name = $fieldRefName]"/> <th nowrap="nowrap" style="text-align:left;"> <xsl:if test="$field/@CountRelated = 'TRUE'"> <xsl:attribute name="style">text-align:right</xsl:attribute> </xsl:if> <xsl:value-of select="$field/@DisplayName"/> </th> </xsl:for-each> </tr> </thead> 2) Add CSS to print thead on each page /*Needed for IE6. Must be stated explicitly to force the thead and tfoot to print on every page*/ thead { display: table-header-group;} tfoot {display: table-footer-group;}

Tuesday, 9 Feb 2010 09:48 by Cameron
Reading the Templates from the root URL for single deployment. You can modify the fullURL to read the templates from any site in the same domain. Replace _tk_getListHTML function in printfunction.js: function _tk_getListHTML() { var oTemplates = document.getElementById("tk_idPrintTemplates"); // i.e. fullURL = http://root.com/PrintTemplates/defaultListPrint.xsl var fullURL = window.location.protocol + "//" +window.location.host +_tkp_pathToPrintTemplates + _tkp_printTemplatesListName + "/" + oTemplates.value; return _tk_TransformXml(fullURL, _tkp_currentPrintXml); }

Tuesday, 9 Feb 2010 11:07 by Cameron
Disregard my last message, it still doesn't work.



Url

Email

Comments