mail merge address labels - suppress empty fields

Asked by DavidJones

I want to print address labels through Open Office Writer, using data from an Open Office Database. I have succeeded in printing the labels, but I can't seem to prevent empty lines appearing on the labels where there are empty fields in the address.
I have tried to use "Hidden Paragraph" with a condition like LabelAddresses.Sheet1.ADDR2 == "", but still get the blank lines on the label. Any ideas? Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Pursell
Solved:
Last query:
Last reply:
Revision history for this message
Tony Pursell (ajpursell) said :
#1

Hi David

Is your 'database' of addresses a Base database or a Calc spreadsheet?

I get round this by using a Calc spreadsheet as the data source and having the whole address in a single cell, by putting Ctrl-Rtn at the end of each line. That way there are no blank lines in the data, which you would get with each part of the address in its own field or cell.

Tony

Revision history for this message
DavidJones (manorbarn) said :
#2

Thanks Tony,
The data is actually in a spreadsheet, which was created from a Foxpro
Table under Windows, so if I can find a way to keep the data consistent,
but still produce the results that would be preferable. It is more or
less the last link before I can scrap Windows for ever!
Thanks
David

On 25/11/2010 14:00, Tony Pursell wrote:
> Your question #135450 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/135450
>
> Status: Open => Answered
>
> Tony Pursell proposed the following answer:
> Hi David
>
> Is your 'database' of addresses a Base database or a Calc spreadsheet?
>
> I get round this by using a Calc spreadsheet as the data source and
> having the whole address in a single cell, by putting Ctrl-Rtn at the
> end of each line. That way there are no blank lines in the data, which
> you would get with each part of the address in its own field or cell.
>
> Tony
>

Revision history for this message
Tony Pursell (ajpursell) said :
#3
Revision history for this message
DavidJones (manorbarn) said :
#4

Thanks Tony.
The data is actually in a spreadsheet, which was created from the master table in a Foxpro database under Windows, so if I can find a way to keep the data consistent, but still produce the results, that would be preferable. It is more or less the last link before I can scrap Windows for ever!
David

Revision history for this message
Tony Pursell (ajpursell) said :
#5

Hi again

Different instructions, more along the lines of your original solution are here

http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Printing_mailing_labels

Tony

Revision history for this message
DavidJones (manorbarn) said :
#6

Thanks Tony
I will try that
David

Revision history for this message
DavidJones (manorbarn) said :
#7

Hi Tony
Still no success. Do I need the full databasename.tablename.fieldname in the condition? Currently I just have fieldname.
Also in my label, I have Addr2, Addr3, County and Postcode, all of which need conditional hiding.
Thanks

Revision history for this message
Tony Pursell (ajpursell) said :
#8

Hi David

I found that the instructions in

http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Printing_mailing_labels

worked best. Follow the instructions carefully and to the letter! They tell you how to hide all the fields and, yes, you do need databasename.tablename.fieldname in the condition.

Tony

Revision history for this message
DavidJones (manorbarn) said :
#9

Hi Tony
I have followed the instructions to the letter, but all the lines with conditional hide are now hiding, even if the conditional field contains data. The only thing I am doing differently is that the data is coming from a query rather than the raw table. Should the queryname be incorporated in the condition somehow?
Thanks
David

Revision history for this message
Tony Pursell (ajpursell) said :
#10

Hi David

The query name just replaces the table name. I.e. the condition is

![database.queryname.fieldname]

I assume you used the query name when you set up the data fields on the label.

Are the lines with conditional hide that have data, completely gone, or are they replaced by blank lines?

Tony

Revision history for this message
DavidJones (manorbarn) said :
#11

Hi Tony
I have a database called LabelAddresses, with a table called Sheet1, with a query called ChristmasCards, which just selects those which have a logical field XMCARD TRUE.

At the moment there are paragraphs on the label
LabelAddresses.Sheet1.NAME
LabelAddresses.Sheet1.ADDR1
LabelAddresses.Sheet1.ADDR2 Hidden Paragraph condition ![LabelAddresses.Sheet1.ADDR2]
LabelAddresses.Sheet1.ADDR3 Hidden Paragraph condition ![LabelAddresses.Sheet1.ADDR3]
LabelAddresses.Sheet1.TOWN Hidden Paragraph condition ![LabelAddresses.Sheet1.TOWN]
LabelAddresses.Sheet1.COUNTY Hidden Paragraph condition ![LabelAddresses.Sheet1.COUNTY]
LabelAddresses.Sheet1.POSTCODE Hidden Paragraph condition ![LabelAddresses.Sheet1.POSTCODE]
LabelAddresses.Sheet1.Country

In this form the print contains NAME and ADDR1 on all labels and COUNTRY on those which have an entry in COUNTRY, with no blank lines between them.

Thanks David

Revision history for this message
Tony Pursell (ajpursell) said :
#12

Hi David

When I have time, I will make up a spreadsheet in your format and try things out.

Tony

Revision history for this message
DavidJones (manorbarn) said :
#13

Thanks Tony

Revision history for this message
Best Tony Pursell (ajpursell) said :
#14

Hi David

I have tried it and it seems to have worked perfectly. I set up the XMCARD query and used that. I used these instructions

http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Printing_mailing_labels

to insert Hidden Paragraph fields.

If you want, I can email you my test files (spreadsheet, database and two text files) but you will have to email me first with an email address for you.

Tony

Revision history for this message
DavidJones (manorbarn) said :
#15

Thanks Tony, that would be helpful.
Regards
David
<email address hidden>

On 29/11/2010 18:04, Tony Pursell wrote:
> Your question #135450 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/135450
>
> Tony Pursell proposed the following answer:
> Hi David
>
> I have tried it and it seems to have worked perfectly. I set up the
> XMCARD query and used that. I used these instructions
>
> http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Printing_mailing_labels
>
> to insert Hidden Paragraph fields.
>
> If you want, I can email you my test files (spreadsheet, database and
> two text files) but you will have to email me first with an email
> address for you.
>
> Tony
>

Revision history for this message
DavidJones (manorbarn) said :
#16

Problem now solved. The field names, as loaded onto my label, had the field specification with them, so the field appeared as ADDR2,C,35, whereas yours did not, so I modified my conditions to include the field specs, and it worked.
Thanks for you very valuable help

Revision history for this message
DavidJones (manorbarn) said :
#17

Thanks Tony Pursell, that solved my question.