I need to merge name, address, city, state, zip, email address, etc. data from an excel spreadsheet into a pdf form I've created in LiveCycle. The spreadsheet data is manually entered (not data pulled from a database so no XML mapping) and I'm not sure if this makes a difference.
Also, I would like to then be able to distribute their respective forms to the recipients via email. Is this possible?
I'm a novice at creating and using forms and can use any assistance you could provide. Thank you!!
I'm a novice too, I struggled with this. I searched and searched and found the following link to Stefan Camerons forum: http://www.google.com/cse?cx=partner-pub-8713368181993922%3Am7txj8bofwi&ie=ISO-8859-1&q=data+sources&siteurl=forms.stefcameron.com%2FI finally got it to work using Stefan Camerons base form - wouldn't work for me if I started from scratch, don't know why. Here is what I did - I copied his zip file and copied my field into the form, since I needed it to be one form per page, I just extended his subform to be the page length. I can't help you with the email portion but, I can help you populate from excel to the best of my limited ability. This is what worked for me:
1) in the Excel sheet with the data - select all the rows and columns that contain data
(you can't select all rows or all columns has to be a defined range)
right click on the selected range and select 'name' from the menu that comes up
type in whatever you'll remember - customers
save it and save the excel sheet
2) next you have to set a system DSN for the excel sheet to make it accessible
here is the link that shows how to do that - only difference is you select EXCEL options:
http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
just use this for setting up the database.
3) Here is the link to the article, the zip file is at the end of the article. This worked for me:
http://forms.stefcameron.com/2006/10/12/displaying-all-records-from-an-odbc-data-connection/
I tried and tried from scratch but, had to start with his magic form as my foundation. I would make sure it actually worked with his data file before modifying and trying to connect to your data:
4) Once you've verified his original form works with his data - replace his fields with yours, make the subform MovieSF as big as you need, mine was the entire page, so that I had one page per row of excel data, delete his fields replace with yours, you can actually just copy all the fields from your old form into his form.
5) Now you just have to modify the data connection and assign the fields to your field names.
first make a note of what he called his data connection, I think it was ReportDataConn. This can be found with the tabs on the left side of the form - it is a tab called 'data view'
delete his connection and proceed to create yours = BUT make sure it has the same name - right click in the data view tab and select 'new data connection'
--- select 'OLEDB...' - Name it the same as Stefans - very important - click next
--- click the 'build' button - the Provider to select is called : 'Microsoft OLE DB for ODBC Drivers'
--- click next
--- click on 'use data source name' radio button if it isn't already on - and click on the down arrow in the drop down box, the System DSN you created will appear there, select it. Click on the 'test connection' button, it should tell you that the connection was succesful.
--- click OK
--- click the SQL Query radio button and enter the following
Select * from (whatever you named the range in the excel sheet).
---- click next if you get any error message, you did not specify the correct range name. To find out what you named it you can click the table radio button and click on the down arrow, it will show you all the named ranges in your spreadsheet. use that name in the sql query box.
6 ) back to livecycle. If you don't have the 'script editor' already open - select it from the Window menu - the script editor opens up above the form.
7) In the Hierarchy tab = click on/select form1 -
Now in the script editor select the 'initiaze' event -
change all the form names of Stefan's fields to yours. modify all field names to match those you want to display and the case has to match - look back in data view for exact spellings and names. You will have to add as many fields/variables as you need populated. I hope this helps. preview it. It should work...
Good luck.
Mo