Skip to main content
Nintex Community Menu Bar

Print Button - SmartForm

  • April 9, 2015
  • 24 replies
  • 91 views
  • Translate All

Forum|alt.badge.img+6

Hi, I have a k2 smartform and I would like to provide the print functionality to print the form. Please suggest some inputs. Note: I don't want to use browser print option.

 

Regards,

Ram

24 replies

Albarghouthy
Forum|alt.badge.img+16

Dear,

 

1- Add Button and give it Tooltip "Action Button".

2- Add Datalable and set an expression to it:

 

"<script type="text/javascript">$(document).ready(function() { $("[title='Action Button']").click(function() {window.print()});});</script>"

 

** when you click on the button it will show the print pop up.

Translate

Forum|alt.badge.img+6
  • Author
  • April 10, 2015

Hi Mustafa, Thank you for your reply, I know it is very simple to implement, and I followed the steps you explained but I dont where does it get fail.

Attached are the screenshots of Button, Data Lebal, Data Lebal Expression and finally Prinit button on form that is unresponsive. Could you please tell me where I am getting wrong.

 

Regards,

Ram


17045i680349EA35ECF7C9.jpg
12502i15C0A2F0110EBBA4.jpg
13406i00BFF3BC0A7DB838.jpg
17173iF0009183560BDFBE.jpg
Translate

Albarghouthy
Forum|alt.badge.img+16

Dear,

 

you're missing the opening < at the beginning of the expression and please note that you're wrapping it with double quotes "" , remove the wrapping quotes.

 

it should look exactly like this :

 

<script type="text/javascript">$(document).ready(function() { $("[title='Action Button']").click(function() {window.print()});});</script>

Translate

Forum|alt.badge.img+6
  • Author
  • April 10, 2015

Thank you Mustafa, it worked like charm for me. Thnx again

Translate

Forum|alt.badge.img+2

Not Working for me :(

 

we need any javascript referance please guide me.

Translate

Albarghouthy
Forum|alt.badge.img+16

Hi,

 

What version of K2 are you using? 

Can you please show me how you implemented it just to make sure you're not missing anything?

 

 

Translate

Forum|alt.badge.img+6
  • Author
  • March 4, 2016

If I understand you correctly, you want to have a print button and that will give the print functionality, then follow below steps-

 

1. Create a button on Form and in button properties do following-

     17166i15F8FBD16C455F6B.png

 

Hope this helps. Let me know if you face any issues.

Translate

Forum|alt.badge.img+2

Below are the snapshpot of Data label expression.

 

11375iB2811CDB684FED04.png

 

 

Translate

Forum|alt.badge.img+2

we are using K2 Installation Package 4.6.11 (4.12060.1735.1)  this version..

 

still not working :(

 

Thanks for rply.

Translate

Forum|alt.badge.img+2

Please find  the below snapshot of form.

 

 

13965i9F439AAAD43894A8.png

Translate

Albarghouthy
Forum|alt.badge.img+16

Hi,

 

Please check "Literal" property on the data label 

Translate

Forum|alt.badge.img+2

yipeeeeeeeeeeeeeeeeee!!!

 

I resolved the  thanks to all .

 

actually the problem was with one data lable literal property.

 


 11882iCB6A2494C74F66F2.png

literal checkbox must be checked if we use javascript or html tag :)

 

 

Regards 

Karan Bajaj

Translate

Forum|alt.badge.img+2

 

 

Thanks  Mustafa :)

Translate

Forum|alt.badge.img+1
  • March 9, 2016

I tried this and it works really well.  Thank you.

Translate

Forum|alt.badge.img+2

Hi ,

 

How do I avoid printing instructions in the form ? I have instructions added as labels but when I want to print the form , then I would like to avoid printing those labels.

 

How to do this ?

 

Thanks and Regards,

Satya

Translate

Forum|alt.badge.img
  • January 16, 2017

I have used this print button on my k2 form and it works fine in a browser but is it possible to use this in the k2 app for ipad? at present if you hit the print button when using a form in the app nothing happens.

Translate

Forum|alt.badge.img+2
  • July 30, 2017

what if I want to set the frame's width to 100% and then print the page?

Translate

Forum|alt.badge.img+1

This worked great for printing everything on the form.  I added the print button and data label to the view - is there any way to just print the view?  I'm using a list view to select the detail on the item view.

Translate

Forum|alt.badge.img+2

Thanks this works 100%.

 

Now I want to hide all the buttons on the form being printed so that the buttons don't show on the printed pdf file, please help.

Translate

Albarghouthy
Forum|alt.badge.img+16

Hi,


 


I am aware of one way to do this.


 


you will need to hide any view or controls that you don't want to print before triggering the print function


You can configure the print button to hid the view as below:


 


16093i55EF1A62ADE57D20.png


Add two transfer actions as shown above to do the following:


 


1- Clear data label


2- transfer the following script to the data label


 


<script>window.print();</script>

HTH

Translate

Forum|alt.badge.img+1
Thanks a lot Mustafa. This is awesome.
Translate

Forum|alt.badge.img

Hi 
I have tried exactly as you told but when button is clicked nothing happens (its like a button that is not configured ).Please helpm to resolve this issue

@Mustafa wrote:

Dear,

 

you're missing the opening < at the beginning of the expression and please note that you're wrapping it with double quotes "" , remove the wrapping quotes.

 

it should look exactly like this :

 

<script type="text/javascript">$(document).ready(function() { $("[title='Action Button']").click(function() {window.print()});});</script>




15947iB16B6E6B448B63B5.png

Translate

Albarghouthy
Forum|alt.badge.img+16

Hi   @DeepakChacko


 


Can you make sure you have the data label property 'literal' checked and if you are using k2 Five, make sure to uncheck 'prevent XSS' property


 


HTH

Translate

Forum|alt.badge.img+4
  • Nintex Partner
  • May 12, 2020

I am trying to print but the Checkboxes are not being displayed. 

Translate