I have created one InfoPath form with two views and published it into the document library. I want to have a print button on the form so that I can print the document.
How to achieve it?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI have created one InfoPath form with two views and published it into the document library. I want to have a print button on the form so that I can print the document.
How to achieve it?
Try to use the below steps,
Procedure
The following is the procedure to create a Print button. We are using HTML and JavaScript for the solution.
Step 1: Enable Modeless forms
By default the view/edit forms are opened as dialog (modal) forms. We need to change this to edit the page.
Choose "List" > "List Settings" > "Advanced Settings"
Set the last option to No.
Now you can see the View form is opened in full page mode.
Step 2: Edit Page
Open a list item in View Form, choose the "Site Actions" > "Edit Page" option to bring the page to edit mode. Add a Content Editor Web part and enter the following HTML contents.
Click OK to save the changes. Choose Stop Editing from the page tab.
We added a Print button that will invoke the window.print() method on click.
Step 3: Test the page
Refresh the list and open a list item in View Page. Click on the Print button
Step 4: Enable back dialog
Now we need to re-enable the dialog form. Go to "List Settings" > "Advanced Settings" and enable the "Dialog" option.
Or You can use WireBear InfoPath Printer.