Printer friendly with Enterprise Portal (EP)


Having a printer friendly view seems to me a quite basic feature, but unfortunately this isn’t the case for the EP. Fortunately the guys from Eggheadcafe had a great idea which permits you to create a printer friendly view with ease. (Thank you for that!) Here’s my version for the EP:


Just  add a “Web Form Part” on your menu (or anywhere else on your site) and then copy and paste the following code :



   1:  <SCRIPT LANGUAGE=”JavaScript”> 
   2:   
   3:  function PrintThisPage() { 
   4:   
   5:  var sOption = “toolbar=yes,location=no,directories=yes,menubar=yes,”; 
   6:  sOption += “scrollbars=yes,width=750,height=600,left=100,top=25”; 
   7:  var sWinHTML = document.getElementById(“_spFocusHere”).innerHTML; 
   8:  var winprint = window.open(“”,“”,sOption);  
   9:  winprint.document.open();     
  10:  winprint.document.write(“<html><HEAD>”);  
  11:  winprint.document.write(“<Link REL=’stylesheet’ Type=’textcss’ HREF=’/_layouts/ep/stylesheets/AXEP.css’>”);  
  12:  winprint.document.write(“<Link REL=’stylesheet’ Type=’textcss’ HREF=’/_layouts/1033/styles/ows.css’>”);  
  13:  winprint.document.write(“</HEAD><body>”);  
  14:  winprint.document.write(sWinHTML);  
  15:  winprint.document.write(“</body></html>”);  
  16:  winprint.document.close(); winprint.focus(); 
  17:   
  18:  }
  19:   
  20:  </SCRIPT> 
  21:  <a href=javascript:PrintThisPage();>Printer Friendly Version</a>


Comments (3)

  1. Some days ago I presented a quite simple way to have printer friendly EP pages . Since sometimes it’s

  2. Glen says:

    This is handy! <div id="printerFriendly"> at the top of your webpart and then close the </div> where you want it to end and add the script to the bottom of the page. With a modification to the 3rd line of JavaScript to be;

    var sWinHTML = document.getElementById("printFriendly").innerHTML;

  3. Peter says:

    Thanks a lot! I was looking for this solution.

Skip to main content