How to pull data from a Database to a PDF form depending on data enter in a field

Basically I want to connect a form to a database and have the user to select on enter information to a field. Then have it to queier the database and fill in the form with the information in the database. Is this possible to do? If it is how?


malloydavid


5 Answers

Voted Best Answer

Wow, you have got a few bumps to get over before you will be able implement anything close to what you are talking about doing.

You'll find some helpful info here:
http://www.pdfscripting.com/public/department48.cfm

The first thing you need is some perspective. LiveCycle Designer is a tool for creating a special type of PDF form, called an XFA form (or XML form). Both Acrobat and Adobe Reader know how to interact with XFA forms. So the user's only needs Acrobat or Reader, they do not need LiveCycle to use these forms. LiveCycle is only a design tool for creating the form.

XFA forms are a relatively new technology. There is also a traditional AcroForm model. To create an AcroForm you add form fields to a regular PDF using Acrobat Pro or Standard. So you have two forms technologies AcroForm and XFA. You create AcroForms in Acrobat and XFA forms in LiveCycle. But both form types are displayed and used in Acrobat and Reader.

The only forms technology that can talk directly to a DB is XFA. If you want to create XFA forms you will need to learn about XFA form design and the XFA Scripting model. However, XFA forms will only connect to a local DB from Acrobat, not Reader. By local, I mean a DB on the user's file system. Possible a shared drive. It is possible to connect the form to a remote DB, but the user will need to have the correct DB drivers installed on thier own system. This DB connection will not work (or work reliably) for random users on the internet. Also, it only works for users on Windows. A Mac user will not be able to use a DB connected form.

The only way to reliably connect the form to a remote DB, for any user, on Windows or Mac, and from Reader or Acrobat, is through a server script that handles the data transactions. Your project is not impossible, it's just a steep uphill climb.


By Thom Parker   

You need to create a an XML form using LiveCycle Designer and the create the data connection in that form and use the necessary code to pass the SQL commands to the SQL compatible data base. Too much for one post.

Have you looked at the Learning Center on this site?

Database Connected Forms

Stefan Cameron on Forms


George Kaiser   

I have serveral very detailed video tutorials and example files on this topic at:
http://www.pdfscripting.com/public/34.cfm#XFADBForms

However, this technique is tricky. It only works reliably (or at all) for a local database. It does not work for distributed forms, and there are big issues for Win 7 and 64 bit because the necessary drivers aren't there. And it only works on Windows. There is no equivelent for Mac.

Another option is to connect the form to a server DB throught the form submit functinality. To do this you need to write a server script to handle the actual transactions with the DB.

Thom Parker
The source for PDF Scripting Info pdfscripting.com

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work


Thom Parker   

If you're using a version of Acrobat prior to X, then you can do it with a form created in Acrobat (you don't have to use LiveCycle), but it is quite tricky and requires a lot of scripting knowledge.
I have a working example of such a PDF and a live database connection available here:
http://try67.blogspot.co.il/2009/05/a...

-------------------------------------
Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


Gilad D (try67)   

It only needs to pull the records that is associate with that one partical person. It is basically like doing a Mail Merge in Microsoft Word.

The file would have to be posted to the intranet site where the extended right would have to be applied so the end user would be able to use it. I would have the IT guy at the site to setup the local databases for the users.

It seems like this project is going to be impossible to do because the end user is not going to have livecycle just adobe reader. Plus if it is anything more than them entering in a name or pressing a button it might be a little too much. We just got Microsoft Office here a year ago. Plus they have most of the sites blocked and disabled the capability to watch videos on the internet to learn how to do the things that they need me to do and I don't even have full access to everything on my computer. What make it worst it that I have been doing thousands of form for them with just Acrobat and livecycle and thats it. No other adobe product so basically I have be working with one arm behind my back so I am pretty good at making forms but this one is a little more difficult to do.

Here is what I am using.

My operating system is XP.
I have Acrobat X
I have Livecycle
I am trying to connect to a local access database
I have the excel file with the data but it is in the 2010

Here is what I have done so far.

I know how to get it to link to the local access database using Livecycle, but I am pretty lost after that and I am not great with coding.

Here is the information that I was looking for.
1. Do I need to make the field inside of Livecycle or acrobat?
2. Do I need to name the fields in a certain way?
3. Do I need to put special coding in the backround of the fields?


malloydavid   


Please specify a reason: