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

Importing data from excel

Gillian
Registered: Jul 10 2007
Posts: 63

I am using the drop-down list object. I have an excel spreadsheet with 100 items in the list. I want to import the list from excel, just once. It's static data and won't change. It's for a purchase req and the User just has to select their department.

How do I import the data from the excel spreadsheet into the dropdown list?
Thanks
Gillian

-Gillian

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Hmm, you want to do a one time design side opertion. LiveCycle really isn't setup for this sort of thing. But short of manually entering the data there are a couple of possibilities for making the process easier. First, to hard code the items in the drop down list you need to change the "Template" model and not the "Form" model. The "Template" is what LiveCycle Designer creates. The "Form" is what's displayed to the user in Acrobat. Changes made to the "Form" are temporary and changes made to the "Template" are permanant.

so here are a couple ideas,
1. Save the Excel data as an XML format, then modify it to match the List format in the LC Template. Then Copy it directly into the XML editor in LiveCycle Designer.

Or better yet. Save you're list as a Library component and then modify it. Now you'll be able to drag and drop your list onto any from.

2. Use a "data connection" to connect to the Excel file then read in all the entries directly into the Template Model. You'd use code similar to what's done in the "Data Drop-Down" in the Custom library. But instead of loading the entries into the "Form" model, load them into the "Template" model. To do this the JavaScript has to modify the XML, the regular list operations don't work.

Once the data is loaded, save the file, reopen it in LiveCycle and delete the data connection.


I hope this helps,

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/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script