Populating Fields from Database Information

Discuss the word processor
Post Reply
mojohn
Posts: 19
Joined: Sat Feb 09, 2008 1:50 am
Location: The Show-me State

Populating Fields from Database Information

Post by mojohn »

Hello. I'm working on a project for my church.

Volunteers take a test and we save their top 5 strengths in a database. The list of strengths (there are 30 or so) are in the first row of the database and, using a Database form, the user checks boxes to indicate the top 5 strengths, which are saved as "yes/no" data in the second (and succeeding) rows of the database.

I have a Writer document into which I would like to put 5 fields that would populate with the names of the volunteer's 5 specified strengths. I'm familiar with how to create form letters, but the methodology doesn't seem like it will work with this kind of document. If anyone could help me set up each Writer field so that it pulls the appropriate strength "name" from the database, I would be very grateful!

Thanks,

Mojohn

OpenOffice.org 2.3.1 on Ubuntu Feisty Fawn (7.04)
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Populating Fields from Database Information

Post by foxcole »

mojohn wrote:I have a Writer document into which I would like to put 5 fields that would populate with the names of the volunteer's 5 specified strengths. I'm familiar with how to create form letters, but the methodology doesn't seem like it will work with this kind of document.
Why would it not work? Mail merge is indeed the method you need for pulling database fields into a Writer document. You don't want the mail merge wizard for this, however. Are you familiar with the Writer Guide chapter 11, Using Mail Merge? (It seems to me you must be, but it's worth asking.) There's no difference between the form-letter fields in the example and other kinds of fields.

After you register the database, follow the instructions in "Creating a form letter". (Create your document, view> Data sources, type the content and drag and drop the database headers into your document to insert the fields, choose Print and answer "yes" to the prompt about whether to create a form letter; or you can follow the instructions for "Saving as a file rather than printing").

Have you tried it? What did not seem to fit your needs?
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
mojohn
Posts: 19
Joined: Sat Feb 09, 2008 1:50 am
Location: The Show-me State

Re: Populating Fields from Database Information

Post by mojohn »

Fox, it seems to me that if I follow your suggestion, I would need to drag 30 fields onto my document. Then I would have to do something (a conditional setting, perhaps?) to delete the fields for which the database shows "no". Is that possible?

Thanks,

Mojohn

OOo 2.3.1 Ubuntu Feisty Fawn (7.04)
OOo 3.1.X on Ubuntu 9.10
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Populating Fields from Database Information

Post by foxcole »

mojohn wrote:Fox, it seems to me that if I follow your suggestion, I would need to drag 30 fields onto my document. Then I would have to do something (a conditional setting, perhaps?) to delete the fields for which the database shows "no". Is that possible?
Yes. Have a look at the Writer Guide chapter 11, "Removing blank lines in addresses." It discusses how to prevent extra lines from appearing if that field contains no data.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Post Reply