Recently I needed to create a print friendly version for a client's web search results. I was unwilling to store the search results using complex LotusScript, Agents, etc.
The solution was simply a matter of using JavaScript in the $$SearchResults form that when selected will re-execute the search using a different view and $$SearchResults Form. Displayed via a new Window -- it works great and looks professional.
You need to use an alternate View/$$SearchResults form to control the print friendly formatting.
The key to the solution is capturing and modifying the result Form's Action/method and simply re-executing the method.
Code
Example & Code:
a) create a new View (called SearchView2)
b) Create a plain $$SearchResults for SearchView2
c) add the following function to the JSHeader in the original $$SearchResults Form
=================================================
function printFriendly(frm) {
var formAction = document._DominoForm;
newURL = formAction.action;
re = "SearchMax=250";
re1 = "SearchView2";
newURL2=newURL.replace(re, "SearchMax=10");
newURL3=newURL2.replace(re1, "SearchView1");
window.open(newURL3,'Window Title', 'toolbar=no,location=no,resizable=yes,
scrollbars=yes,directories=no,
status=no,width=640,height=480')
}
===================================================
Note: The above JS will replace the original view (SearchView1) with
the new View (SearchView2) and limit the number of results to 10.
d) Create a Link to the JS Code eg.
(all passthru HTML)
<div align=right><a href="javascript:void(0)"
onclick="printFriendly(this)">Printer Friendly version</a>
<div>