Link to home
Start Free TrialLog in
Avatar of kanthi chandra kanamala
kanthi chandra kanamala

asked on

Printing an InfoPath Form from a SharePOint List

I have an InfoPath form implemented on a SharePoint List in SHarePoint Online. How do I print out the InfoPath form.
Avatar of Uttam (Kukdai) Dhakal
Uttam (Kukdai) Dhakal
Flag of United States of America image

Add a printer function in the list newform or editform or display form web part.
Edit one the form and add a script editor and write following code int he script editor web part

<input id="printpagebutton" onclick=" printpage()" type="button" value="Print"/>
<script type="text/javascript">
    function printpage() {
        var printButton = document.getElementById("printpagebutton");
        printButton.style.visibility = 'hidden';
        window.print()        
        printButton.style.visibility = 'visible';
    }
</script>

<style>
@media print {
#s4-titlerow{
display:none !important;
}
/*hide here all the elements that you don't want to print*/
</style>

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.