locked
populate list values on the form template and print that form?? RRS feed

  • Question

  • Hi All,

    i got a requirement wherein i need to populate field values into form and print that form. FYI, we are not using Info path form. so idea is to create a form template with few fields and get the values from a list and then print that values with fields. Please suggest better approach.

    Thanks

    Friday, June 10, 2016 9:48 PM

Answers

  • Hi rakib,

    Navigate to the list->open display form->add a content edit web part, add the following code in to CEWP:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
    <script>
    
    $(document).ready(function() { 
    
      $('.printMe').click(function() { 
      window.print();
      return false; 
      }); 
    
    });
    </script>
    <style>
    .printMe {
    	COLOR: #666666; CURSOR: pointer; FONT-WEIGHT: bold
    }
    .printMe:hover {
    	COLOR: #333333; CURSOR: pointer; FONT-WEIGHT: bold
    }
    </style>
    <button class="printMe" type="submit" jquery152008332169968186703="1">Print</button> 

    Then you can print the list display form:

    For more detailed information, refer to the following article to add a quick print button to a display form in SharePoint 2010 using jQuery:

    https://chayadigital.wordpress.com/2013/02/19/add-a-quick-print-button-to-a-form-display-in-sharepoint-2010-using-simple-jquery-snippet/

    Best Regards,

    Lisa Chen


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, June 13, 2016 6:42 AM

All replies

  • Here is the link for you

    https://social.technet.microsoft.com/Forums/office/en-US/4a4d09ec-344c-44ee-8bfb-1445da5c6307/sharepoint-2010-list-to-populate-form-library-template?forum=sharepointgeneralprevious


    Please remember to click &#39;Mark as Answer&#39; on the answer if it helps you

    Friday, June 10, 2016 10:27 PM
  • i looked into the link but they are using Info path form. As i mentioned we cannot work on info path. please suggest.
    Saturday, June 11, 2016 1:50 PM
  • Hi rakib,

    Navigate to the list->open display form->add a content edit web part, add the following code in to CEWP:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
    <script>
    
    $(document).ready(function() { 
    
      $('.printMe').click(function() { 
      window.print();
      return false; 
      }); 
    
    });
    </script>
    <style>
    .printMe {
    	COLOR: #666666; CURSOR: pointer; FONT-WEIGHT: bold
    }
    .printMe:hover {
    	COLOR: #333333; CURSOR: pointer; FONT-WEIGHT: bold
    }
    </style>
    <button class="printMe" type="submit" jquery152008332169968186703="1">Print</button> 

    Then you can print the list display form:

    For more detailed information, refer to the following article to add a quick print button to a display form in SharePoint 2010 using jQuery:

    https://chayadigital.wordpress.com/2013/02/19/add-a-quick-print-button-to-a-form-display-in-sharepoint-2010-using-simple-jquery-snippet/

    Best Regards,

    Lisa Chen


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, June 13, 2016 6:42 AM