Conditional Whitespace for Mail Merge

Hi,

I want to set a conditional whitespace with "conditional text" based on my
Title field of my address database. So I thought I only have to set a
conditional text with [title] or [title] != "" condition and place a
whitespace else do nothing.
But the result is just everyone a whitespace is set.
Can anyone confirm this behavior or describe a different solution to print
my title field if there is content?

thanks very much all.

regards,
Sven

Composing the lines of an addressing area is easy to do with a query. Details
depend on the type of your database.

In Writer you can use a conditional field with a nested data source field
like this:
If condition: DataSource.QueryName.Title != ""
Then: " "

So it's a Calc sheet actually. I would simply use Calc to concatenate the
proper field contents and then use that calculated field for the mail merge.
Something like =TRIM($A2&" "&$B2&" "&$C2) with a column title in the firs
row copied down along the list.

A database query would be easier to handle because it automatically applies
to the whole record set:
Something like:
SELECT
LTRIM(CONCAT("Title",CONCAT(' ',CONCAT("ForeName",CONCAT(' ',"LastName")))))
AS "Full Name",
<other fields>
FROM "Sheet1"

This looks horrible because there is only a very limited set of functions
when you mis-use a spreadsheet for a database connection. But with the right
double-quoted names of sheets and columns it will generate a calculated
"Full Name" field on the fly.
Availlable SQL-functions with file based data sources
<http://www.openoffice.org/dba/specifications/file_based_functions.html>

Doing this in the last element of the chain is difficult. The only resource
I know is
http://openoffice.blogs.com/openoffice/2007/05/suppressing_bla.html
describing a solution for a similar problem.

Hi Andreas,

thank you for your effort. :slight_smile:

I got the fail.
Our concluded condition is working correctly.

Field type -> Conditional Text
Condition: [Titel] != ""
Then: " "
Else: ""

Now the big BUT!
If I click me through the mail merge assistant I got a document preview
where I can scroll through the data sets.
The document preview is displaying the whitespace anytime. (this lead me
astray)
If I print/save the mail merge document I can see that die conditional text
is working correctly. :slight_smile:

I will file an error for this document preview behavior.

Thank you very much.

regards,
Sven

That wizard is counter productive and irritating for several reasons. You can
create serial letters easier without it. Once you have a registered database
connection to your list (F4 shows your database and tables), all you need to
do is this:
Select your table or query in the left pane and then drag column headers
from the right pane into your document.