Answered
I am using LiveCycle Designer ES to customize new hire enrollment forms. These are blank insurance enrollment and payroll setup forms. We add employee information (name, dob, doh, address, etc... populated by a database) to create signature ready documents. We need to create a separate form for each employee. The forms are printed and distributed to employees in a paper format. I can view the first record in LiveCycle. How do I print the custom forms from LiveCycle? Thanks in advance for your help.
The first bit is to make sure the connection is being opened. Once you've go this bit you can add code to navigate the DB.
In a Livecycle form the DB connection is under the "sourceSet" model. Look this up in the "XML Forms Object Model Reference" and you'll find a list of all the functions that can be used with the connection.
For example, assuming you have a data connection called "MyConnection", add a button to the top of the form and label it "Next". Set the presence so that the button doesn't print. Place the following code in the click event:
xfa.sourceSet.MyConnection.next();
Every time the button is clicked the DB record will advance and display new data on the form. When you print the form the "Next" button will not be visible. You could even Automate the process, in fact I'll be adding an automation tool for doing exactly this to www.pdfscripting.com later this month.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script