MarkRS wrote: ↑Tue Dec 13, 2022 10:38 pm
Is that enough information to be clear?
No. I understand more about what you're doing and thank you for providing your Writer document, but I don't know what is in your data source.
The values for the fields to be shown in your Writer document,
Envelope.odt, come from your data source, which is a Base document. In your case, the Base document gets the data from an Evolution database. But what's important is the data coming into the merge from the
LibreOffice Base driver connecting to the Evolution database, not the Evolution database records themselves.
When viewed in Base, a database has records which contain fields, a 2-dimensional structure. But it is unlikely that this is how data is stored in Evolution. The address book layout I'm familiar with (the MacOS Contacts application) involves 28 interconnected tables, and I will guess that Evolution, since it is also an address book, is similarly complex. The driver has to map the Evolution data into the 2-dimensional structure needed by Base. I have neither Evolution nor LibreOffice, and OpenOffice Base is not able to connect to the contacts.db file which you attached, so I have no idea what the Base driver has returned from the Evolution connection.
However, as a test of multi-line fields I created my own Base document to connect to the following CSV file which I put in its own folder:
full_name,home_addr_line1,home_addr_line2,home_addr_City,home_state,home_zip,home_country
My Full Name,"Address 1 first
Address 1 second","Address 2 first
Address 2 second",My City,My State,My ZIP,My Country
File → New → Database → Connect to existing database → Text → Next → specify path to folder → Comma Separated Values → Next → Register → Finish
Then I open your
Evolution.odt document → Edit → Exchange database → select the database I just registered → File → Print → Form Letter? → Yes → All records → OK
- 202212141414.odt
- Resulting Writer document after merge
- (10.91 KiB) Downloaded 284 times
You can see in my attached Writer document
202212141414.odt that the mail merge fields for
home_addr_line1 and
home_addr_line2 each have two lines, as do the fields in my CSV file.
Thus I have demonstrated that a mail merge field can display more than one line of text. Above,
John_Ha also finds this to be the case, as long as the data source has the proper text for the field.
MarkRS wrote: ↑Tue Dec 13, 2022 10:38 pm
I suspect the problem is that Evolution terminates fields with a semicolon, and seems to do the same with separate lines in that first field, added after the \n character to indicate new line.
I'd say it's the responsibility of the
LibreOffice Base driver for Evolution to process the semicolon-delimited fields correctly and return the data to the merge. Perhaps you've discovered a limitation in that driver which causes it to not retrieve the information which you expect. Potential workaround (which I have not tested): import Evolution's data into the MacOS Contacts application, then use File → New → Database → Connect to existing database → Mac OS X Address Book. Questions about how to import Evolution into Contacts would be off-topic for this forum.
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).