Bug 76995 - MAILMERGE: Wrong record Number in Mailing
Summary: MAILMERGE: Wrong record Number in Mailing
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other Windows (All)
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: BSA target:5.1.0
Keywords:
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2014-04-03 11:53 UTC by ClDc
Modified: 2016-12-07 19:02 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Contains document to print, data base, step by step - 3 files in tosend folder (242.74 KB, application/zip)
2014-04-03 11:53 UTC, ClDc
Details
results with 5.1.0.0 (158.17 KB, application/x-zip-compressed)
2015-12-02 17:17 UTC, ClDc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ClDc 2014-04-03 11:53:44 UTC
Created attachment 96840 [details]
Contains document to print, data base, step by step - 3 files in tosend folder

Problem description: 
I don't have an English version installed, so menus name could be not exactly the one expected

While printing type letters ( File --> print --> yes to question, "do you wish to print type letters"
I wish to print the record number in the data base

Steps to reproduce:
1. Create a Mailing document for a xls or ods file as data base
2. Insert in the document the record number as explained in:
https://help.libreoffice.org/Writer/Database
Insert --> Fields --> Other --> Database --> type = record number

3. Print a type letter
File --> Print --> yes to the question :"do you wish to print a type letter"


Current behavior:
1) If I create a unic file containing all documents, all the documents have the same number ( empty or a value)

2) If I create an ODT file for each document, each one has a correct number ( from 1 to the number of file in DB or result of filter on DB)

3) If I create an PDF file for each document, all the documents have the same number ( empty or a value)

4) If I do the same tests with mailing assistant(Tools --> Mailing assistant)
Even the ODT files for each document ( as in step 2) are wrong

Expected behavior:
Each document, using any print mode, has a record number in the data base or in the result of a filter in the data base.
I expect to print that one ( which is not a page number)

I have the same issue wit Apache OpenOffice 4.0.1
I have recently installed LibreOffice and last OpenOffice version. I was able to use this option since 2006, with a previous OOO version, I don't remember wich one, may be before it became Apache.
I use this option to print fiscal documents once a year.
              
I attach list_mvt.ods the database, on which a filter should be applied: 
Nom not empty 
and
Montant > 0

then "Lejeune" should have number 3 when printing

bulletin.odt is the document to print
change the database in order to link it to list_mvt.ods

etapes.odt contains step by step screen shots ( In French)


Operating System: Windows 7
Version: 4.1.5.3 release
Comment 1 pierre-yves samyn 2014-04-04 09:30:51 UTC
Hello

I reproduce on windows 7/64 & Version: 4.2.3.2
Build ID: 7c5c769e412afd32da4d946d2cb0c8b0674e95e0

Thank you for reporting

Regards
Pierre-Yves
Comment 2 ClDc 2014-04-07 07:11:27 UTC
The last feature version, working correctly, I used, is the one of OOo 3.3.0 ( before Oracle)
Comment 3 ClDc 2014-07-30 07:58:14 UTC
still there with:
Version: 4.2.5.2
Build ID: 6ff819b65674ae6c83f3cbab9e4a4c2b292a7a94


and even worse as, except I am wrong, standard Filter applied on data document  doesn't work

on list_mvt.ods the database, a filter should be applied: 

Nom not empty 
and
Montant > 0

But has no effect, and is not saved ( File --> print --> yes to question, "do you wish to print type letters" --> define and  apply the filter).
Comment 4 ClDc 2014-08-12 10:23:40 UTC
Not working with 4.3.x.
Comment 5 ClDc 2014-08-12 12:43:04 UTC
(In reply to comment #3)

Forget my comment about filter, this is managed in Bug 82057 https://bugs.freedesktop.org/show_bug.cgi?id=82057

To summarize, record number is  wrong in versions: 
4.1.5.3, 4.2.5.2, 4.2.6.2, 4.3.0.4 of LibreOffice
 and also Apache OpenOffice 4.1.0
at least.
Comment 6 Björn Michaelsen 2014-08-21 12:17:16 UTC Comment hidden (obsolete)
Comment 7 Björn Michaelsen 2014-10-10 01:02:42 UTC
Mailmerge has recently been refactored heavily on master, could you please test a recent daily build, details see:

 https://wiki.documentfoundation.org/QA/Testing_Daily_Builds#Where_can_I_get_Daily_Builds.3F
Comment 8 ribotb 2014-10-10 08:26:56 UTC
Hi,

With
Version: 4.4.0.0.alpha0+
Build ID: 9aa36a1ad39e37c372cc833a44fba450b8cc30cd
TinderBox: Win-x86@42, Branch:master, Time: 2014-10-09_03:25:27

With File --> Print  :

1) If I create a unic file containing all documents, all the documents have the same number ( empty or a value)

> it's now correct

2) If I create an ODT file for each document, each one has a correct number ( from 1 to the number of file in DB or result of filter on DB)

> it(s always correct

3) If I create an PDF file for each document, all the documents have the same number ( empty or a value)

> it's now correct

4) If I do the same tests with mailing assistant(Tools --> Mailing assistant)
Even the ODT files for each document ( as in step 2) are wrong

> it's OK in the two cases : single document or one document for each record

Bernard
Comment 9 ClDc 2014-10-10 09:09:20 UTC
Hi,

I did the test with:
Version: 4.4.0.0.alpha0+
Build ID: 7f900e2e2f5faa0a568209791c57cb024f14fe33
TinderBox: Win-x86@51-TDF, Branch:MASTER, Time: 2014-10-10_00:12:08

Still not working, same results I described while opening the bug.
Comment 10 ClDc 2014-10-10 13:16:04 UTC
Version: 4.4.0.0.alpha0+
Build ID: 7f900e2e2f5faa0a568209791c57cb024f14fe33
TinderBox: Win-x86@42, Branch:master, Time: 2014-10-10_00:12:03


Not working, same behaviour described when I created the bug

Only individual odt files are correct
Comment 11 ribotb 2014-10-10 15:10:43 UTC
Sorry, I had not completely tested.

I re-tested with File > Print.

If I use standard filter to select one or several records, record number is wrong when printed record(s) is(are) saved as single or individual odt document. Record number seems to be an incremental number starting to 1.

But when I print all the records as single or individual document, record number is correct in both cases (not the same number, but I think that is an increment like in my test with only several records).
Comment 12 ClDc 2014-10-22 10:53:39 UTC
Hi,

I did the test with:
Version: 4.4.0.0.alpha1+
Build ID: 9ecac3874d179b1d7aa6b45337001b1def06a9dd
TinderBox: Win-x86@42, Branch:master, Time: 2014-10-22_06:31:01

still not working with or without filter.
Same behaviour I described when I opened the bug.

Thanks for your time.
Comment 13 tommy27 2014-11-30 20:06:16 UTC Comment hidden (obsolete)
Comment 14 Alex Thurgood 2015-01-03 17:38:13 UTC Comment hidden (no-value)
Comment 15 putude 2015-06-24 14:42:08 UTC
This bug still occur in
Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: en_US

--------------------

I have the same problem. 
Mail merge render 400 pages, but it appeared 800. 
Changing Format 
--> Page --> Page --> Layout Setting 
Page Layout: Right and Left 
displaying similar result with
Page Layout : Only right

best regards,
putude
Comment 16 ClDc 2015-10-28 17:35:07 UTC
same behaviour with:

Version: 5.0.2.2
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale : fr-FR (fr_FR)
Comment 17 Commit Notification 2015-11-05 17:59:48 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d7144b71eeb132b00bd555495d9547c3b859ceaa

tdf#76995: updated cached value on Evaluate() of db name field

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 ClDc 2015-12-02 17:17:36 UTC
Created attachment 120963 [details]
results with 5.1.0.0

Hi,
Thanks for your update.
Sorry for the delay.

I did test on Windows 10 64 bits

With :

Version: 5.1.0.0.alpha1+ (x64)
Build ID: d667e3210b12c7ce3b3727e2a0e369a520fbaaa4
Threads 4; Ver: Windows 6.19; Render: default; 

TinderBox: Win-x86_64@42, Branch:master, Time: 2015-11-25_01:47:38
Locale: fr-FR (fr_FR)

JAVA   64 bits 1.8.0_66


It is better but one case is not working: 

 when individual pdf files are generated , all contain the data of the first records.

Othewhise, individual odt,  single pdf, single odt are working

I attach the results in test5100.zip (got with the testcase attached previously)
Comment 19 ClDc 2015-12-08 10:50:45 UTC
Version: 5.1.0.0.beta2+
Build ID: 52ac1a717b1869cb7d2ee710f50a15e216ced76c
Threads 8; Ver: Windows 6.2; Render: GL; 

TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-1, Time: 2015-12-06_22:28:00
Locale: fr-FR (fr_FR)

Same behaviour than discribed in previous comment and attached results.

- results for  individual odt,  single pdf, single odt are correct
- results for  individual pdf are not correct, all the files contains the data of the first record in the data base.
Comment 20 ClDc 2016-12-07 16:34:50 UTC
I did the test with:
Version: 5.2.3.3 (x64)
Build ID: d54a8868f08a7b39642414cf2c8ef2f228f780cf
Threads CPU : 8; Version de l'OS :Windows 6.19; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: group


My test case is working.

Thanks
Comment 21 tommy27 2016-12-07 17:04:18 UTC
is the bug still present or not?
Comment 22 ClDc 2016-12-07 18:24:58 UTC
In my environment Version: 5.2.3.3 (x64), ( see my previous comment)
with my testcase, attached to this bug when it was opened, it works.
Comment 23 tommy27 2016-12-07 19:02:45 UTC
so this means RESOLVED WORKSFORME