Opening And Printing All Links To The Infopath Forms, Together

We have our search result Web part configured to show only the different list items, based on the query. For every list, we have InfoPath form associated. Around 20-25 items are the result of the search result Web part. We have updated our display template to open every link in the new tab in the same Browser Window.

Also, a customer wants to take the printout of all these forms. Thus, to take the printout, he needs to click each and every link from the search result. Go to every tab and print the form.

Thus, this is a little bit of a tedious process. If there are 25 links shown in the search result, they need to click 25 times for opening each link in the new tab and then 25 more clicks to give the print command by going to each and every form. This approach is not liked by the customers and they were asking to minimize the clicks required to print all the forms.

Customer Requirement

Customer wants to minimize the efforts required to print all the links (forms) shown in search result Web part.

Our Approach/Solution

I saw such a kind of requirement for the first time, Googled a lot and put a lot of time into thinking about how we can achieve this. Hence, we broke this requirement in the two sub requirements, which are:

  1. Printing all the tabs together.
  2. Opening all the links in tabs.

Printing all the tabs together

After a lot of Googling, I found one Add-on to FireFox Browser, which prints all the tabs together.

Add-on name – Universal Print - https://addons.mozilla.org/en-US/firefox/addon/universal-print/

This is a very good Add-on, which provides the features like:

  1. Print current tab
  2. Print all the tabs
  3. Print selected tabs

These features are very useful and our work is half done. We have added this Add-on in FireFox Browser. Thus, after opening all the tabs, we need to right click on any tabs and the following options come, as shown in the following figure:
figure

The only limitation to this approach is our customer, who needs to use only FireFox Browser. Since at the customer side, only 4-5 users are taking print outs, so it's no problem to the customer to use FireFox Browser.

This is only half done. Customer still needs to open 20-25 clicks to open all the links in the tabs and then one more click for the printing.

Opening all the links together/at a time in tabs

Opening all the links at one click is not a big job, since we may have JavaScript, which will open all the links in the tabs. Following is the approach, we used:

  1. Added content editor Web part on Search result page.
  2. Write JavaScript to open all the links from our search result Web part in the Browser tabs.

    JavaScript snippet
    1. <script type="text/JavaScript">   
    2. function openlinks()  
    3. {  
    4.   
    5. var links = document.links;  
    6. for(var i =0; i<links.length; i++) {  
    7. //This condition is for opening only our links from the search result web part  
    8. if(links[i].toString().indexOf('Source')>=0){  
    9. window.open(links[i]);  
    10. }  
    11. }//for  
    12. }//function  
    13. </script><input type="button" onclick="openlinks();" value="OpenAllLinks"/>  

Finally, we managed to print all the links in the two clicks.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now