none
Printing InfoPath 2013 form content in SharePoint 2013 RRS feed

  • Question

  • Hi,

    I have a list customized my InfoPath 2013 in SharePoint 2013. I need to print the InfoPath form and save into PDF/word. If I use window.print() method in Content Editor webpart it prints all other links, menus and contents on the window but I need to print only the content on the InfoPath form.

    Could anybody help to achieve this? Thanks in advance.


    Sunday, April 8, 2018 1:33 PM

All replies

  • Hi,

    Try the following script:

    <script src="/scripts/jquery-1.9.1.min.js" type="text/javascript"></script> 
    
    <script type="text/javascript">
    
      $('.ms-WPHeader').hide();
    
      $('.ms-WPBorder').css('border', 'none');
    
      setTimeout(function() {
    
        window.print();
    
      }, 500);
    
    </script>
    

    How to add this code, please refer to:

    http://thingsivefoundout.blogspot.sg/2013/10/creating-printable-infopath-form.html

    Best Regards,

    Dean Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, April 9, 2018 7:43 AM
    Moderator
  • Hi,

    You should open the infopath form in infopath designer and enable the print ribbon from it. 

    Once its done, a print button will be shown in the infopath itself.

    That works far better than hiding extra html and using window.print. 

    It is advisable to create a print view as well. (in case you have hidden some data in current view)


    Please remember to mark the replies as answers and upvote them if they help. Thanks & Regards, Balu

    Monday, April 9, 2018 9:09 AM
  • Hi Balu,

    Thanks for your replay. Would you please guide how I can display the print button on InfoPath when it is opened in SharePoint with list item?

    Thanks in advance.

    Monday, April 9, 2018 10:15 AM
  • Hi Dean,

    Thanks fro your suggestions. Could you please guide how to implement it on a Button Click. I need to have a button to print the form.

    Tuesday, April 10, 2018 10:50 AM