Discussion:
[libreoffice-users] Conditional Whitespace for Mail Merge
Sven Schüring
2015-02-10 22:05:34 UTC
Permalink
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
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and
Andreas Säger
2015-02-11 19:42:03 UTC
Permalink
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: " "



--
View this message in context: http://nabble.documentfoundation.org/Conditional-Whitespace-for-Mail-Merge-tp4139674p4139762.html
Sent from the Users mailing list archive at Nabble.com.
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Sven Schüring
2015-02-12 11:59:41 UTC
Permalink
Hi Andreas,

thanks for your reply.

I've a Calc-Sheet with address data (linked with Writer it was transformed
to a database).
In my used Writer (LO 4.4) the query does no work properly.
The query described by you would be in my case [my calc
sheet].members.title != "" but only [title] != "" is interpreted correctly.
:-/ (why?)
But in my case the whitespace is printed anytime.

Condition: [title] != ""
Then: " "
Else: <empty field>

I think there could be a bug?
Can you confirm my described behavior?

regards,
Sven
Post by Andreas Säger
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
If condition: DataSource.QueryName.Title != ""
Then: " "
--
http://nabble.documentfoundation.org/Conditional-Whitespace-for-Mail-Merge-tp4139674p4139762.html
Sent from the Users mailing list archive at Nabble.com.
--
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be
Andreas Säger
2015-02-12 15:23:55 UTC
Permalink
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.



--
View this message in context: http://nabble.documentfoundation.org/Conditional-Whitespace-for-Mail-Merge-tp4139674p4139885.html
Sent from the Users mailing list archive at Nabble.com.
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Sven Schüring
2015-02-12 15:52:42 UTC
Permalink
Hi Andreas,

thank you for your effort. :)

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. :)

I will file an error for this document preview behavior.

Thank you very much.

regards,
Sven
Post by Andreas Säger
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
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.
--
http://nabble.documentfoundation.org/Conditional-Whitespace-for-Mail-Merge-tp4139674p4139885.html
Sent from the Users mailing list archive at Nabble.com.
--
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly a
Andreas Säger
2015-02-12 16:53:22 UTC
Permalink
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.



--
View this message in context: http://nabble.documentfoundation.org/Conditional-Whitespace-for-Mail-Merge-tp4139674p4139898.html
Sent from the Users mailing list archive at Nabble.com.
--
To unsubscribe e-mail to: users+***@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Loading...