[Solved] Mailmerge: problem with 'next record' field

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
amanchesterman
Posts: 10
Joined: Sat Mar 30, 2013 9:48 am

[Solved] Mailmerge: problem with 'next record' field

Post by amanchesterman »

I have encountered a problem using the 'next record' field with mailmerge. I'm not sure if it's my mistake or if it's an issue with the software, so I'm raising it here in case anyone wants to explain or comment. If this isn't the right sub-forum please feel free to move this thread.

The scenario is that I have set up a split-file database to hold names, addresses, phone numbers, other personal information. I have fairly complex reporting requirements (including word-wrap, conditional paragraphs etc.) so I am creating the output by inserting fields in a Writer document. However the problem arises with even with the simple case of printing a list of names, so I'll write about that here.

I created a new document (call this Document 1), pressed F4 to open data sources, navigated to the query that contains the data to be printed, and dragged the field header into the document. That inserts the <Name> field. Then with my cursor at the end of that field I did Insert > Fields > Other > Database tab > Next record, selecting the correct query from the list of registered sources. Viewing field names (Ctrl+F9) shows the <Name> field followed by the <Next record> field, as you would expect. I then copied and pasted that line a few times to create a short list. When I print the document it asks if I want to print a form letter and brings up the data selection dialogue. I choose to print (say) the first 3 records but it does not print the first three names from the database down the list: rather, it repeats the first name down the list, then the second name down a second list, and so on.

Then I created another document (Document 2) and did F4 to open data sources, but this time I dragged the whole query into the document. The dialogue comes up and I chose 'insert data as fields', selecting (for simplicity) only the <Name> field. It creates a list of names exactly as I wanted, one name after another down the list. But when I view the field names (Ctrl+F9), each entry in the list looks exactly the same as in Document 1 -- i.e., the 'Name> field followed by the <Next record> field on each line.

Curiouser still, if I copy the <Next record> field from Document 2 and use that to replace the <Next record> fields in Document 1, then Document 1 works perfectly, and I get a list of names one after another as I want them.

So clearly, the <Next record> field in Document 2 (which is created by the 'insert data as fields' dialogue) works differently to the <Next record> field in Document 1 (which is created by the 'Insert > Fields > Other >Database > Next record' dialogue), even though the field names are apparently the same. My puzzle is why, and how can I use the 'Insert > Fields > Other >Database > Next record' command to get the correct result?

TIA, John
Last edited by amanchesterman on Wed Apr 03, 2013 2:30 pm, edited 1 time in total.
OpenOffice 3.4.1, Ubuntu Linux 12.04 LTS
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Mailmerge: problem with 'next record' field

Post by acknak »

There is a bug in the Insert > Fields > Other > Database > Type: Next Record for Apache OO 3.4. I suspect that is the root of your problem here.

Are you still using that version? The bug is fixed in 3.4.1, or you can fix the problem yourself if you can't upgrade.
AOO4/LO5 • Linux • Fedora 23
amanchesterman
Posts: 10
Joined: Sat Mar 30, 2013 9:48 am

Re: Mailmerge: problem with 'next record' field

Post by amanchesterman »

Hi and thanks for your reply. Yes, I was using version 3.4.0 and I have now upgraded to 3.4.1. But the problem persists as I described it.
One thing I noticed before, and noticed again repeating the experiment just now: when I do Insert > Fields > Other > Database > Type: Next Record there is a 'Condition' field in the dialogue box and the text in there says 'sal_True'. I have no idea what that means so I haven't tried to change it. But might that have something to do with it? At present, the printout does move on to the next record, but only when it has printed the first record all the way down the list; whereas I want it to move to the next record after printing the first one only once.
Thanks, John
OpenOffice 3.4.1, Ubuntu Linux 12.04 LTS
User avatar
Villeroy
Volunteer
Posts: 31348
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Mailmerge: problem with 'next record' field

Post by Villeroy »

The F1-help is useful indeed (in this particular case at least).
Writer->Index: conditions;in fields and sections
Scroll down to "Conditions and Database Fields"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Mailmerge: problem with 'next record' field

Post by acknak »

amanchesterman wrote:... there is a 'Condition' field in the dialogue box and the text in there says 'sal_True'. I have no idea what that means so I haven't tried to change it. But might that have something to do with it? ...
Sorry, I didn't explain this well.

That "sal_True" thing is the bug. That field should be just plain TRUE. The value is recorded in the Next_Record fields in your document, so doing the upgrade will prevent the problem with new documents but it won't fix the problem for old documents that already have fields with the incorrect condition setting.

Just edit your fields to have TRUE in the condition, or delete and re-insert them again. They should be correct with the new version.

Sorry for the missing info.
AOO4/LO5 • Linux • Fedora 23
amanchesterman
Posts: 10
Joined: Sat Mar 30, 2013 9:48 am

Re: [SOLVED] Mailmerge: problem with 'next record' field

Post by amanchesterman »

Many thanks acknak, your guidance is very clear and it works perfectly. Thank you also Villeroy for pointing out the useful article in the Help menu.
Good wishes
John
OpenOffice 3.4.1, Ubuntu Linux 12.04 LTS
Post Reply