Just about everyone knows how to copy and paste information from a data source. The problem I'm having is that it's more complicated than that.
I am trying to populate fields in a writer document with information from a database. Here is the scenario: There is already a layout for the project. What happens is that there is a table that spans about four cells, and stores a userdata field called letter. Then under that, there is a table the same width that actually has four cells. They store fields called Lastname, Firstname, Phone, and Fax. Their current values are Last name, First name, Phone, and Fax, respectively. I already have the database I need as a registered data source. The table in the database I am using has five fields, letter, lastname, firstname, phone, and fax. The field is the letter their last name starts as. As far as I know, thats automatic somehow. Anyway, the document needs to start at the first letter, A, and print "A" in the that one-column table. Then, the heading that says Last Name, First Name, Phone, Fax. All of those are bolded and underlined. Under that, it needs to populate those fields with all the entries that have "A" as the letter. Under that, a new table needs to be automatically created just like the old one, only it Prints "B." Then the same heading with Lastname, first name, phone, fax. And once again, populate it with all the B's. After that it goes to the next letter and so on and so on. I figured how to populate the fields once if i change them into mail merge fields, but then it tries to create one document for each entry, and I dont need 1200 documents. Also, I suspect it would make the Letter heading for every entry, even if i did manage to get them into one file. There has to be a way where it just takes the data, pulls the first letter, then prints the heading, the data while letter == letter, then loops again and again till end of file. I'd like to just make a webpage, but that's not really an option. Plus the layout is already done. This was originally done in OpenOffice 1.1 and the original author doesn't remember how it was done. Do I need to make a macro or is there some way I can make it loop like that and fill the document? Please respond with any information you have. I have posted this problem all over the internet and have yet to get a single response. what I'm trying to do can't be completely unheard of. It was obviously done before, just with the older version. You would think it would be easier with the new version. Any help would be appreciated.
