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

Form & Database Connection Viewing with Reader

jshesek
Registered: Jul 23 2007
Posts: 25

Hi,

I created a form in LiveCycle that pulls in information from a local access database.
Can I create a button that (that shows in reader) will pull the latest info from that database - when the user is in Reader? (Kind of like the Forms -> Manage Forms -> Import Data in Acrobat Pro.)

Or is there a way to edit a LiveCycle form in Acrobat Pro and add the button there?

Jess

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Importing data into Reader is a bit tricky, It' even trickier with a LiveCycle form. If you're initial effort was with an AcroFrom button action then I have to assume you're using the "Import Form Data" action. This action is great because for whatever reason it is not subject to security restrictions. The reason probably because the path to the FDF data file is fixed. It can't be changed at runtime.

If you want to run it on a LiveCycle form there is an easy way. Open the LC form in Acrobat Pro and add a bookmark action. The bookmark action can be run from a button click on the form with this code

event.target.bookmarkRoot.children[0].execute();

But unfortunately this won't work on a dynamic LiveCycle form. The first reason is that FDF imports into PDF form fields. There are no such fields on a dynamic form, they only exist on a static LC form. The second reason is the field names in LC are really paths through the hirearchy. It's very difficult to build an FDF with the correct format. And the last reason is that an FDF imports data into PDF form fields, not the LC data model where it needs to go to be saved with the form.

There are some fancy workarounds you could do. For example, attach a regular AcroForm to the LC form. Then do updates to the form data through this attachment.

However, I understand this data workflow you're trying to implement is for a controlled environment. If you have a server you have another option. Write a server script to access the DB. Then use data submits to update the user forms. Forget about using FDF on a LiveCycle form.

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

jshesek
Registered: Jul 23 2007
Posts: 25
Thanks for answering so quick. So complicated. All I'm trying to do is create a fax cover sheet where the employee's info can't be changed. Is there a better way?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
But you want the data to come in from an external source like a DB, correct? Is there a large amount of data? If it is only a few entries then they could be hard coded in the form. Also is there a reason it has to be a LiveCycle form since it's only one page? Why does the field have to be expandable?

The whole Reader/DB access thing is locked up so you can't pull directly from the DB. There is no way around having an alternate methodology for getting the data, and in fact, the only thing that works on reader without special stuff is importing an FDF using the "import Form data" action and submits to a server script.

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