unhide/hide a field (table) using a button.

Missile64

20-09-2015

‌I have a table set to hidden and want to unhide it using a button and to hide it using the same button. If the table is left visible I don't want it to be able to be printe. Any suggestions?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Magus069

MVP

22-09-2015

Alright, seems like it does not keep the flow of the form...

Another work around you can use that will work for sure would be the following:

1. Keep this code in the button click event

2. In your hierarchy, click on the table you want to hide when printing, go in the prePrint event and put this line (prePrint is before printing)

3. Now in the postPrint event you can put the following line to put back the table visible (postPrint is after printing)

Keep in mind that if the Table is hidden when printing, the table will appear in the postPrint.

So if you want to avoid this, you can have a hidden text field that keeps in memory how you should display the table after printing.

If you do this, you can change the value "visible" for TextField1.rawValue

You can put the text field's value using the button click event, when changing the presence value of the table change the text field's value as well

Hope this will help!

Answers (5)

Answers (5)

Missile64

21-09-2015

‌Every thing is flowed, all fields except the table are in flow able sub forms, and everything is enclosed in 1 flowable sub form.

am I able to send you a copy of the form?

Missile64

21-09-2015

‌Works great except when I print it leaves a gap where the table was. I have the table default as hidden (exclude from layout).

thanks for your assistance so far.

Magus069

MVP

21-09-2015

Hi there,

in the button click's event you would have have something written like the following :

Make sure to put this in a JavaScript event

Hope this Help!