These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How To Print Form And Leave Certain Fields Blank

jimmyn
Registered: Nov 2 2010
Posts: 12

I have created a purchase order with livecycle, and i need to have a print button on the page that will print the entire purchase order except the fields that contain the pricing, i need them to remain blank. Is there a script I can use to do this? Any help at all is appreciated greatly.
 
Thanks,
Jimmy
 

My Product Information:
LiveCycle Designer, Windows
pforms
Registered: Nov 17 2009
Posts: 87
Maybe something like:

TextFieldName.presence = "hidden";
jimmyn
Registered: Nov 2 2010
Posts: 12
I failed to mention that i need two print buttons on the one form. One button will print everything, while the second button will create a print that will leave out the price fields.
jimmyn
Registered: Nov 2 2010
Posts: 12
Anyone have any experience doing this? I am confident it can be done, because i have used purchase orders in the past with this same feature. Any direction at all would be greatly appreciated.

Thanks,
jimmy

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You will have to create a custom button and add the necessary FormCalc or JavaScript to print the selected pages.

George Kaiser

DaveyB
Registered: Dec 10 2010
Posts: 70
jimmyn wrote:
I failed to mention that i need two print buttons on the one form. One button will print everything, while the second button will create a print that will leave out the price fields.
Create the real print button to print the entire form. This will be the "print everything" button you mentioned above.

Create a second button and have it execute some short scripts before calling the "print" function. You can use the scripts to access the field properties and set the offending fields to "hidden" or simply adjust the font colors for those fields to "white on white".

For the font changes, the examples provided in the help file are:
JavaScript
TextField1.fontColor = "150,130,33";
FormCalc
TextField1.fontColor = "150,130,33"

This sets the RBG colors for the font, so setting them to "255,255,255" (hex: ffffff) will hide the field contents from the printer without removing the field borders (in case the field still needs the borders in the printed version).

Another method of achieving the same end, assuming you want to suppress the fields entirely, would be to set the price fields as part of a separate sub-form, and simply suppress that entire subform via the Object Palette / Subform tab / Presence by changing it to "Visible (Screen Only)". This can be done via a simple script.

In this instance, I would caption the second button as "Prices XXX" where the XXX represents the current status (on or off), and have it toggle the subform on or off on successive clicks. Set a "Form Properties" variable to retain this data, and have the toggle button update it's own caption when clicked.

Hope that helps :)

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

jimmyn
Registered: Nov 2 2010
Posts: 12
Davey,

Thank you so much for the advice. I finnally was able to get it to work. This solution has created another issue.

I created a second print button and ran the scripts to change the font color to white, then back to black after the print action. This portion works perfect, however, now the regular print button is running the text color script when it is clicked as well. I even tried creating a new print button and for some reason it is running the font color chagne script as well.

Is there a script i can put on the regular print button that will override the font color change script? If not, any idea why the scripts set on the second print w/o pricing button is carrying over to the regular print button?

Thanks for the help.
Jimmy