| View previous topic :: View next topic |
| Author |
Message |
howard OOo Advocate

Joined: 28 Feb 2004 Posts: 320 Location: Newfoundland
|
Posted: Sat Mar 21, 2009 1:28 pm Post subject: Data from database to tables in a writer document? (Solved) |
|
|
I have a data table (originally a calc spreadsheet, but I have converted it to a odb file) I want to insert the data from the rows in the table (5 items) into a set of tables which also include a fair bit of text (the same in each table), several to a page.
I have registered it, dragged the labels to where I want them and made multiple copies, but I cannot work out how to get the data sequentially into the tables. All the tables carry the same data when I click "data to fields" instead of going down the list. I seem to remember something about "next record" when I last did something like this years ago, but cannot remember how to do it.
(I imagine I could make a database report to do this, but I looked at that and don't have the time to learn how to do that at present, especially as I seem to be so close the way I'm going.) _________________ Howard
3.41 (Vanilla) on various versions of PCLinuxOS and XP Home (hardly ever used!)
Last edited by howard on Sun Mar 22, 2009 8:51 am; edited 1 time in total |
|
| Back to top |
|
 |
howard OOo Advocate

Joined: 28 Feb 2004 Posts: 320 Location: Newfoundland
|
Posted: Sun Mar 22, 2009 8:11 am Post subject: |
|
|
Thanks for all the help guys It's always more satisfying to solve these things yourself.
After playing around with the labels option and trying to design a custom label. I found what I wanted - the "next record" field is to be found under Insert>fields>other (database tab). I went back to my table, inserted "next record" into the last box copied and pasted it 19 times and "Hey Presto!"
Column labels can't have spaces in them by the way!
Labels and Business cards are, after all just special cases of a writer document. _________________ Howard
3.41 (Vanilla) on various versions of PCLinuxOS and XP Home (hardly ever used!)
Last edited by howard on Sun Mar 22, 2009 8:50 am; edited 1 time in total |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8982 Location: Lexinton, Kentucky, USA
|
Posted: Sun Mar 22, 2009 8:25 am Post subject: |
|
|
Try this:
Open new Writer document, press F4, open the database, open the Tables item & click your table.
Select the desired records with the gray boxes to their left.
Click the Data to Text icon, put the bullet in Table and go from there. |
|
| Back to top |
|
 |
howard OOo Advocate

Joined: 28 Feb 2004 Posts: 320 Location: Newfoundland
|
Posted: Mon Mar 23, 2009 3:44 am Post subject: |
|
|
Thanks John, I wondered when I was going to hear from you. In fact my method worked, so I didn't check yours out.
I designed my table, brought up the database with F4, dragged the column titles into the table where I wanted the items (no spaces!), put the "next record" in the last cell of the table (from insert fields>other). Then I copied and pasted the number of copies I wanted, highlighted the records I wanted to include and clicked on "Data to fields". It worked. _________________ Howard
3.41 (Vanilla) on various versions of PCLinuxOS and XP Home (hardly ever used!) |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8982 Location: Lexinton, Kentucky, USA
|
Posted: Mon Mar 23, 2009 5:25 am Post subject: |
|
|
| You should a least try the Data to Text method to see what it offers. A quick and dirty way to list database records with a choice of what records and what fields are included. |
|
| Back to top |
|
 |
howard OOo Advocate

Joined: 28 Feb 2004 Posts: 320 Location: Newfoundland
|
Posted: Mon Mar 23, 2009 7:35 am Post subject: |
|
|
OK John, I had a quick look at that but it doesn't do what I was trying to do. Data to text just creates a table of the selected items and records.
I was wanting to insert details into a series of identical tables with a lot of repetitive text in them as well and with varying numbers of cells in each row. More or less like a form letter, but with several copies per page. I imagine you could do the same with a paragraph. I cannot give you a copy as it refers to a confidential legal matter. _________________ Howard
3.41 (Vanilla) on various versions of PCLinuxOS and XP Home (hardly ever used!) |
|
| Back to top |
|
 |
howard OOo Advocate

Joined: 28 Feb 2004 Posts: 320 Location: Newfoundland
|
Posted: Mon Mar 23, 2009 8:23 am Post subject: |
|
|
I just had a further thought, can you make up a set of tables or paragraphs which include data from more than one database? It turns out you can.
I created a paragraph:
"Hi <name> how are you. You owe me <sum>.
Where <name> and <sum> come from different databases. I discovered you have to put in a "Next record" for both databases, but then you can make a number of copies, link to the database of names add in a set of names using "data to fields", switch to the one with money and insert the sums without altering the names.
The form letter instructions in the OOo help only deal with identical letters being sent to different addresses, but you could also insert different information from another database too as long as you made sure that the data were in the same order as the addresses. Probably fairly useless as you'd most likely have it all in the same database. _________________ Howard
3.41 (Vanilla) on various versions of PCLinuxOS and XP Home (hardly ever used!) |
|
| Back to top |
|
 |
|