Expand my Community achievements bar.

populate form fields on load

Avatar

Level 1

I'm supporting a commercial web site that uses a mysql database on a shared unix server.  I use php.  I've gone through the literature and it looks like LiveCycle Designer is designed to work easily with odbc on windows.  Is there any easy way to populate form fields from the mysql db on the unix box like there is for odbc?  This is just for printing; not for editing or saving.

Thanks

10 Replies

Avatar

Former Community Member

The support of ODBC connections is on the client machine where the form is opened as opposed to where the database is physically located (on Unix in your case). Although you can accomplish this, I do not recommend it unless you are dealing with a small number of local users. The reasons are that on each physical machine you will have to setup and maintain a DSN connection for the connection to use. This cannot be automated by the form. Once that connection is defined then the form can leverage it. This form functionality will only work on Windows machines. Maintaining that DSN can be a maintenance nightmare in big environments. As well the users have to be on the same physical network as the DB. This means that remote users cannot get to that server.

Paul

Avatar

Level 1

Thanks for your reply.  There will be a small number of clients using the form.  I can create a dynamic xml file on the clients or server.  Do you if there's a way to automatically load the form fields from the xml file on either client or server when the form is initialized?

 

 

Avatar

Former Community Member

You can import the xml files after the file loads by using a button and having a file dialog where the user can import the files, or if the xml file is set up correctly it can point to a location where th eform can be loaded. This was discussed in a previous post. Remember that you will have to Reader Extend the form to get the database connectivity functional for Reader users.

Paul

Avatar

Level 1

Thanks, Paul.

 

I can use the data::docReady event and prompt the user for a file by coding  xfa.host.importData().  Is there some way to code an event and have the data load automatically from the xml file into the form without having to prompt the user?

 

 

Avatar

Former Community Member

You cannot load the data programmatically after the form is rendered without certifying the document (this is considered assecurity risk)....you can use the other technique where you launch the data file and have it point to a template. This assumes that the template is in the same location for everyone and that you can modify the data file to add the template inforamtion. This was the other technique I mentioned in my previous post.

Paul

Avatar

Level 1

Can you point me in the right direction to find out how to make the data file point to the template.

 

Thanks again

Avatar

Former Community Member

If you only have a couple of fields to pass to the user this option may be a better technique:

http://forms.stefcameron.com/2006/10/20/using-url-requests-in-pdf-forms/

I cannot find the other post that was refering to the data merge. Basically there is a reference to the form to load in the data file.

Paul

Avatar

Level 1

Thanks, Paul.  I'll check that out.

 

Avatar

Former Community Member

I found the information on the other technique. If you save the data out in an XDP format (XML data package). Then the data is there as well as a reference to the template. To do this you can use the Forms/Manage Date/Export Form Data. Choose XDP as a file type in the dropdown. Look at the XDP in any XML editor, you will see all of the data and a reference to the PDF at the bottom of the XDP. Now close Acrobat/Reader and launch the XDP, if the form is in the right location your form and data will load.

Paul

Avatar

Level 1

Thanks again, Paul.  I'll check this out asap.