Bug 80810 - Field aliases from MySQL query not correctly applied in mailmerge
Summary: Field aliases from MySQL query not correctly applied in mailmerge
Status: NEEDINFO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version: 4.3.0.1 rc
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-02 14:49 UTC by cpohle
Modified: 2015-01-03 17:38 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Database browser (opened by F4), not the purely German field labels (95.82 KB, image/png)
2014-07-24 13:13 UTC, cpohle
Details
"Data in text" dialogue - note the now partly English field labels (61.10 KB, image/png)
2014-07-24 13:13 UTC, cpohle
Details
Sceenshot 4.2.6.2 - Fieldnames in English - former in German (155.87 KB, image/jpeg)
2014-10-08 17:45 UTC, Thomas Krumbein
Details

Description cpohle 2014-07-02 14:49:07 UTC
I'm accessing a MySQL database via JDBC for mailmerge.

The writer document contains fields labeled in German like "Anrede", "Vorname", "Name", "PLZ" etc. These are the exact column labels in the database, and they are also displayed in the database browser (F4).

However, mailmerge obviously translates the field names internally, so the fields are not replaced correctly when I select a single row in the DB browser and push the "Data in fields" button. Replacing the fields works well if I manually rename the field references into the English equivalents (like "PLZ" in "zip", for example).

This did not occur in the 4.2 series.
Comment 1 Alex Thurgood 2014-07-14 11:42:32 UTC
Which locale are you using for your mailmerge template ? Or rather, what does LO give as the default locale in the status bar at the bottom of the screen ?

When you mention mailmerge, do you mean that you are using the Print facility, rather than the mailmerge menu entry ?

A sample db and document template would be useful, especially if this is a locale issue, as otherwise it might be hard to reproduce.
Comment 2 Alex Thurgood 2014-07-14 11:43:41 UTC
If you can't provide a template and ODB, then please provide step-by-step instructions, otherwise we'll be second guessing what it is that you have done.
Comment 3 Alex Thurgood 2014-07-14 11:44:34 UTC
Additionally, did you exchange the default Addressbook database for your own db ?
Comment 4 cpohle 2014-07-24 13:13:03 UTC
Created attachment 103397 [details]
Database browser (opened by F4), not the purely German field labels
Comment 5 cpohle 2014-07-24 13:13:40 UTC
Created attachment 103398 [details]
"Data in text" dialogue - note the now partly English field labels
Comment 6 cpohle 2014-07-24 13:13:49 UTC
The locale according to the status bar is "Deutsch (Deutschland)".

I actually created an ODS sheet with the records (quite some time ago with a former version of LO). I then created a database file as a proxy and registered this database as source in LO.

I'm trying to use the "Data in fields" ("Daten in Felder" i German) button from the toolbar.

When I click the "Data in text" button, I get the dialogue attached as Screenshot2.png. Note how the field labels from the list view in Screenshot1.png (just as defined in the database) differ from the labels in the "Data in text" dialogue.
Comment 7 cpohle 2014-07-24 13:26:12 UTC
(In reply to comment #6)
> I actually created an ODS sheet with the records (quite some time ago with a
> former version of LO). I then created a database file as a proxy and
> registered this database as source in LO.

Sorry, thats not true. As stated in my original comment, data comes not from an ODS, but from a MySQL database.
Comment 8 cpohle 2014-07-24 13:33:24 UTC
I just became aware of a fact that made me change this bug's summary/title.

The German field labels are defined in the SQL query string like

SELECT field1 AS Feld1,
UPPER(field2) AS Feld2,
...

What happens is that field labels for fields calculated via a SQL function (e.g., "UPPER(...)") are correctly applied/visible in Writer, but all fields that are just aliased (like field1 in the example given above) are not treated correctly and keep their original names as defined in the original database.

Sorry for my misleading original problem description!
Comment 9 Alex Thurgood 2014-07-30 13:06:08 UTC
Hi,

I imagine that your query has been saved in the corresponding ODB file ?
When you execute that query there, i.e. within the ODB file, does the UI display the aliases correctly ?


Alex
Comment 10 cpohle 2014-07-30 13:35:10 UTC
> I imagine that your query has been saved in the corresponding ODB file ?
> When you execute that query there, i.e. within the ODB file, does the UI
> display the aliases correctly ?

Yes, Base displays correct column headers.
Comment 11 Alex Thurgood 2014-07-30 14:13:50 UTC
Well at least that narrows it down to the mailmerge/Wrtier component
Comment 12 Alex Thurgood 2014-07-30 14:19:20 UTC
Have you declared the datasource as your address book database under Tools > Exchange Addressbok ?
Comment 13 cpohle 2014-07-30 14:52:15 UTC
> Have you declared the datasource as your address book database under Tools >
> Exchange Addressbok ?

No, I've registered it via the preferences dialogue.
Comment 14 Alex Thurgood 2014-07-30 15:00:41 UTC
At the moment, I don't have any non-capitalized field names that I could use as an address source. If there is a problem, then it is in the matching of lower case equivalent field names with those provided by the mailmerge field code.


Additionally, how are you carrying out your mailmerge ? (you never said)

(a) Are you using the Mailmerge menu entry ?

or

(b) Are you inserting fields via dragndrop into your Writer document, and then printing a form letter ?
Comment 15 Alex Thurgood 2014-07-30 15:01:38 UTC
Please give precise steps, otherwise we will spend too much time trying to nail this down.
Comment 16 Thomas Krumbein 2014-10-08 17:39:59 UTC
I´ll just jump in because I got a similar question today. 

Customer uses MAC OS (I don´t know the exact version) and LibreOffice since 3 years. 
Now he has updated to LibO Version 4.2.6.2 and now all is Mail-merge documents doesn´t work any more.

Reason: in former version LibO uses german translated field names - and all mail-merge fields are now fixed to these names. 
the actual version now uses englisch field-names - so merging is not possible.

I added an aktual sceenshot witch may explain the differenz.

So the question is: What was changed?
Comment 17 Thomas Krumbein 2014-10-08 17:45:02 UTC
Created attachment 107571 [details]
Sceenshot 4.2.6.2 - Fieldnames in English - former in German
Comment 18 Alex Thurgood 2015-01-03 17:38:35 UTC
Adding self to CC if not already on


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.