Bug 52586

Summary: Mail Merge doesn't seem to respect a filter
Product: LibreOffice Reporter: Joshua <jfacemyer>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: bugs, caolanm, iplaw67, jfacemyer, miniopl
Version: 4.3.5.2 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=50800
Whiteboard:
i915 platform: i915 features:

Description Joshua 2012-07-27 14:18:55 UTC
Using the standard filter when doing a mail merge does not appear to affect the output of the merge at all. I've tried multiple databases and files with this.

To reproduce:


1. Add fields from a data source.
2. Add a filter. (Note: the filter will work in the data browser/viewer, giving the impression that it will work in the merge.)
3. Complete the merge (to a document or printer, it doesn't appear to matter.) All the records seem to be in place, without respecting the filter that has been applied.
Comment 1 Alex Thurgood 2012-07-27 17:09:36 UTC
There was a similar issue with setting filters via the wizard, it might be related, and if it is, a fix has already been entered.


See here :
https://bugs.freedesktop.org/show_bug.cgi?id=50800


Alex
Comment 2 Roman Eisele 2012-10-05 08:41:54 UTC
@ jfacemyer:

Thank you very much for your bug report! Could you please check yourself if this problem has been fixed, just as Alex Thurgood suggested? The fix mentioned by Alex Thurgood (for bug 50800) should be both in LibreOffice >= 3.5.6 and in LibreOffice >=3.6.0, so you can try this with any of the current versions (3.5.7 or 3.6.2).

And after checking this, please report your results by adding an additional comment to this page.

This would be very helpful. Thank you very much!


(@ Alex:
Thank you very much for the hint about bug 50800!)
Comment 3 Dan 2012-11-07 03:39:28 UTC
I've just installed 3.6.3.2. Going through the mail merge wizard exhibits exactly the behaviour that the OP describes. Using File > Print and choosing the option to print to a file, the filter appears to work correctly.
Comment 4 Mirosław Zalewski 2013-03-07 18:20:32 UTC
There are detailed steps to reproduce:

1. Open new text document
2. From menu: View → Data sources
3. In upper part of window, select "biblio" table
4. Set standard filter to Author = 'Gris, Myriam'
4a. Five rows will remain, identifiers GRM00 to GRM04
5. From menu: Insert → Fields → Other...
6. In Database tab, select Mail Merge fields on left, Bibliography → biblio → Identifier on right; Insert. Close this window.
7. From menu: Tools → Mail Merge Wizard...
8. Go directly to step 6 ("Edit document").

Result:
Identifier field on document will change to "ARJ00", which is NOT visible in Data Sources table. You can cycle through all 20 default biblio table entries.

Expected result:
mail merge wizard should take filter into consideration and work only on rows matching filter settings (that are shown in Data Sources table).

Yes, I know, expected behavior is arguable (should filter just help finding matching data or actually change a range on which mail merge works?). But this is what original reporter expects. I also got personal message from other user who also finds current behavior broken.

This is in no way related with 50800 mentioned earlier. That one is about Base queries, this one is about Mail Merge in Writer.

I could reproduce it on 3.6.5, Debian testing amd64; therefore I mark this as NEW and change OS setting. I also lower importance to comply with <https://wiki.documentfoundation.org/images/0/06/Prioritizing_Bugs_Flowchart.jpg>.
Comment 5 Alex Thurgood 2014-08-08 11:53:42 UTC
Caolan : you're our mm expert I seem to recall -  any ideas ?
Comment 6 Alex Thurgood 2014-08-08 12:10:13 UTC
Step ^ of the wizard is currently lacking a UI dialog, so testing on master somewhat difficult.


The workaround, and the way I have always done this :

1) Set the filter in the data source broswer window.
2) Select the upper left corner of the data source browser and drag and drop this onto the empty Writer document
3) The other mailmerge wizard will start and only copy over the filtered data - the user gets to decide which fields to insert
Comment 7 Alex Thurgood 2015-01-03 17:41:23 UTC
Adding self to CC if not already on
Comment 8 GeBo 2015-01-10 20:19:52 UTC
I can confirm this bug is still active. I use Lubuntu 14.10 with LO 4.3.5.2 Build ID: 430m0(Build:2)

Like Joshua said, I can also filter correctly when using File / Printer, but using the Wizard it always shows the first records.

When I filter in Base, then filtering works as expected.

Recap, Having 6 records, filtering the 4th, 5th and 6th in writer:

File / Printer (to file) gives me record 4, 5 and 6.
Wizard gives me record 1, 2 and 3.

Filtering in Base, wizard gives me record 4, 5 and 6.
(But this would take an extra step, which is not very user friendly.)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.