Skip to main content
Nintex Community Menu Bar

Print friendly Nintex Forms

  • September 11, 2017
  • 3 replies
  • 154 views
  • Translate

Forum|alt.badge.img+16

Without having Nintex Forms Enterprise and the handy "Print to PDF" functionality, we often spend a lot of time on workarounds for this.  My good friend and colleague Gary Powell-Jones‌ came up with this solution that he has allowed me to share with you all:

Print friendly Nintex Forms

Designing the form

The form can be designed to allow items to not be printed (e.g. appear only on screen) or appear only when printed (such as a disclaimer).

For print only items, add a css class of printonly to the control or element

For no print items, add a css class of noprint to the control or element

Note that the JavaScript below will work even if there are no controls or elements with these css classes

Form custom JavaScript

Include the following snippet in the form custom Javascript. It adds a function called ‘PrintFormHtml’ to print the form, a function to hide print only elements when the form is initially loaded.

 

function PrintFormHtml(){

 NWF$('#suiteBar').hide();

 NWF$('.noprint').hide();

 NWF$('printonly').show();

 window.print();

 NWF$('#suiteBar').show();

 NWF$('.printonly').hide();

 NWF$('.noprint').show();

 return true;

}

 

NWF.FormFiller.Events.RegisterAfterReady(function () {

  NWF$(document).ready(function () {

   NWF$('.printonly').css('display','none'); //THIS HIDES PRINT ONLY ELEMENTS

  });

});

Print Button

Add a button to the form, using the JavaScript action. The action will be PrintFormHtml();. Optionally, the button can be made visible on the SharePoint ribbon using the standard Nintex settings

Operation

When the button is clicked it

  • hides the suitebar
  • hides items with the CSS class of ‘noprint’
  • shows items with the CSS class of ‘printonly’
  • calls the printer dialog

 

After printing, it resets the form:

  • showing the suite bar
  • hiding the print only elements
  • showing the no print items
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+7
  • 182 replies
  • October 2, 2017

Thanks Cassey,

Will definitely look at using this.

Translate

Forum|alt.badge.img+3
  • 19 replies
  • December 1, 2017

Hi Cassey,

Going try this now, But I got a feeling I might be back for some assistance

Regards

Translate

Forum|alt.badge.img+5
  • 28 replies
  • March 7, 2019

Very nice. Very nice indeed!

I dug around a bit and didn't see anything about collapsing hidden objects.

Hidding a large area for printing leaves a equivalent blank space in my testing.

Has anyone figured this out?

Thanks

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings