Bug 84290 - MailMerge: Hidden text is visible for labels that have no data record (number of labels on sheet > number of records)
Summary: MailMerge: Hidden text is visible for labels that have no data record (number...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2014-09-24 17:19 UTC by Carlo
Modified: 2018-10-18 18:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Database with 2 records (17.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-09-25 07:24 UTC, Carlo
Details
This file shows the problem (14.14 KB, application/vnd.oasis.opendocument.text)
2014-09-25 07:26 UTC, Carlo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo 2014-09-24 17:19:39 UTC
In my document I am using database fields in order to print labels. There are 2 columns and 6 rows corresponding to the 12 frames where the labels should appear.
At the end of each frame i inserted the field "Next Data Record".
My address is inserted on the top of each label by means of a hidden text field.
The condition to hide the text looks like: Name == ""
This works fine as long as there are enough selected records to fill the page.
If there are fewer records, in all remaining frames there appears my address in the first line of each frame. I suppose that if there is no next data record, the condition Name == "" is not calculated correctly (it should be true), so that the text (the address) is not hidden. I tried alternate expressions like Name == NULL but this did not resolve the problem.
Comment 1 Joel Madero 2014-09-25 05:17:50 UTC
Please attach a document and give clearer reproducible steps (preferably enumerated). Marking as NEEDINFO. Once you do the above mark as UNCONFIRMED.
Comment 2 Carlo 2014-09-25 07:24:15 UTC
Created attachment 106832 [details]
Database with 2 records

This file contains 2 records to be used by the second file
Comment 3 Carlo 2014-09-25 07:26:05 UTC
Created attachment 106833 [details]
This file shows the problem

This file contains database fields connected to TestDat1
Comment 4 Carlo 2014-09-25 07:26:31 UTC
There are 2 files: 
A calc-file „TestDat1“ with two data records 
and
an odt-file „DemoErrorInCondition“ with some database fields.

What I mean can be reproduced by the following steps:
1) Add TestDat1 to the available databases
2) Load DemoErrorInCondition
3) Show the table T1 of TestDat1 (F4)
4) Select the two data records
5) Choose Data In Fields:
	The hidden text in data record 2 is hidden as expected, because the condition 	Name==““ is TRUE
6) Select only one data record (the first)
7) Choose Data In Fields
	The hidden text in data record 2 is not hidden although there is no name as no 	further data record is available
Comment 5 Jan-Marek Glogowski 2014-10-02 20:06:36 UTC
Did this work in previous LibreOffice / OpenOffice versions?

The evaluation of the condition from the point of LO is correct: Name==““ is just true, if there is a dataset and the value of the column Name is an empty string.

The correct test for a missing datapoint is !Name.

I guess setting the condition to '!Name || Name == ""' matches your expected result.

And BTW - there is File => New => Labels, which might help you to set up the initial label document.
Comment 6 Carlo 2014-10-04 12:27:39 UTC
Thank you for your effort, but this does not solve the problem. 
Using  !Name || Name=="" ends up in hiding the text, although it should be shown if there are data available and Name is not empty.
Comment 7 Cor Nouws 2014-10-04 18:58:57 UTC
Hi Carlo,

From my notes, years back, I read that you must use
  !<name datasource>.<name table>.<name field>
or
 <name datasource>.<name table>.<name field> EQ ""

I found it not easy to set conditions for various fields/needs, but this worked.

NB Would you like to hide one line, then keep in mid the difference between Line end (SHft+Enter), which is inserted by the wizard, and Paragraph end (Enter) which is what you need.

Also, pls consider to first ask for user-support. For example there is a group of users with a great variety of skills that can offer help with questions:
  http://www.libreoffice.org/get-help/community-support/
But maybe you did :)

Kind regards
Cor
Comment 8 Carlo 2018-02-10 16:36:34 UTC
This bug is still present in LO 6.
So I suggest, that using conditional text together with database fields (merge fields), should be looked at.
A condition like database.table.field != "" should return FALSE , if no further datasets are available. This is the way Microsoft Word handles such a case.
Regards
Carlo
Comment 9 Cor Nouws 2018-02-10 17:28:31 UTC
Hi Carlo,

(In reply to Carlo from comment #8)
> A condition like database.table.field != "" should return FALSE , if no
> further datasets are available.

When I do a mail merge with labels, I never have that more labels than the available record sets are filled. 
So I don't understand what you want / where that condition would be used for.
Comment 10 Carlo 2018-02-10 17:41:36 UTC
(In reply to Cor Nouws from comment #9)
> Hi Carlo,
> 
> (In reply to Carlo from comment #8)
> > A condition like database.table.field != "" should return FALSE , if no
> > further datasets are available.
> 
> When I do a mail merge with labels, I never have that more labels than the
> available record sets are filled. 
> So I don't understand what you want / where that condition would be used for.

Hi Cor,
this applies to the case, that in the conditional text the sender address is placed. All remaining labels on the page should not show the sender address, just for later use.
Regards Carlo
Comment 11 Cor Nouws 2018-03-09 11:33:55 UTC
(In reply to Carlo from comment #10)

> this applies to the case, that in the conditional text the sender address is
> placed. All remaining labels on the page should not show the sender address,
> just for later use.
> Regards Carlo

Ah, now I get it. Sorry for being so slow of understanding (and busy).

Set as enhancement.