Manage Learn to apply best practices and optimize your operations.

Web print friendly Web searchs (without storing the search results)

alternate View/$$SearchResults form to control the print friendly formatting

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.


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>
 

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close