Bug 147974 - Writer has an issue with multiple .csv address book data source connections
Summary: Writer has an issue with multiple .csv address book data source connections
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.8.1 release
Hardware: x86-64 (AMD64) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-13 21:22 UTC by David
Modified: 2024-06-16 13:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
data source (937 bytes, text/csv)
2022-03-27 18:30 UTC, David
Details
file that uses data source (12.93 KB, application/vnd.oasis.opendocument.text)
2022-03-27 18:32 UTC, David
Details
file that uses data source (79.82 KB, application/vnd.oasis.opendocument.text)
2022-03-27 18:39 UTC, David
Details
A writer document detailing how I set up and use the mail merge function. (136.51 KB, application/vnd.oasis.opendocument.text)
2023-12-23 21:04 UTC, David
Details
file that uses mail merge (95.17 KB, application/vnd.oasis.opendocument.text)
2023-12-24 15:15 UTC, David
Details
file that uses mail merge (16.72 KB, application/vnd.oasis.opendocument.text)
2023-12-24 15:15 UTC, David
Details
a file that uses mail merge (106.25 KB, application/vnd.oasis.opendocument.text)
2023-12-24 15:18 UTC, David
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David 2022-03-13 21:22:53 UTC
Description:
I have a .csv file that contains 26 fields of mixed data.  If I open two files (letter with 5 fields pulled from csv file, and an envelope with 6 fields) the first file will print. If the 1st file remains open, the 2nd file will print. If the 1st file is closed after printing, the 2nd file no longer sees the data connection.  Closing and reopening Writer seems to correct the issue. 
I can provide the documents if needed.
Thank you.

Steps to Reproduce:
1. Open 2 documents.
2. Print 1st document.
3. Close 1st document.
4. Print 2nd document.
5. 2nd doc can't see data source
4. Close Writer and reopen.
5. Open and print 2nd doc.
6. It works.

Actual Results:
It worked

Expected Results:
Each file should see the data connection independently.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.8.1 (x64) / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Dieter 2022-03-27 13:13:33 UTC
David thank you for reporting the bug. It seems you're using an old version of LibreOffice. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?

Please also add the documents, if bug is present in LO fresh.

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version. Change to RESOLVED WORKSFORME, if the problem went away.
Comment 2 David 2022-03-27 18:30:25 UTC
Created attachment 179145 [details]
data source

It should sit in your downloads folder for the test
Comment 3 David 2022-03-27 18:32:54 UTC
Created attachment 179147 [details]
file that uses data source

Envelope uses the data source for addresses.
Comment 4 David 2022-03-27 18:39:27 UTC
Created attachment 179148 [details]
file that uses data source

On my system, I have the 2 odt files in a directory in my documents folder called "CCSA cards".  The csv file is located in my downloads directory (called "downloads").
Comment 5 David 2022-03-27 18:40:51 UTC
I've included the files.  I did test with the new version and I get same result.
Comment 6 Buovjaga 2022-12-21 11:39:34 UTC
(In reply to David from comment #0)
> Description:
> I have a .csv file that contains 26 fields of mixed data.  If I open two
> files (letter with 5 fields pulled from csv file, and an envelope with 6
> fields) the first file will print. If the 1st file remains open, the 2nd
> file will print. If the 1st file is closed after printing, the 2nd file no
> longer sees the data connection.  Closing and reopening Writer seems to
> correct the issue. 
> I can provide the documents if needed.
> Thank you.
> 
> Steps to Reproduce:
> 1. Open 2 documents.
> 2. Print 1st document.
> 3. Close 1st document.
> 4. Print 2nd document.
> 5. 2nd doc can't see data source
> 4. Close Writer and reopen.
> 5. Open and print 2nd doc.
> 6. It works.

Is printing really required? Do you see the same issue when saving as document(s)? I can't test printing right now (sadly it does not offer to print to a file), but your files worked fine when saving as a document.

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED WORKSFORME, if the problem went away.

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8389048cb41291917449e87b2901d6133bce3373
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 21 December 2022
Comment 7 Buovjaga 2022-12-21 16:40:48 UTC
David sent me a direct email, which seems to confirm that our results are different:

I can easily reproduce the issue. I have several documents that access the data source.  When I close one, the other doesn't see the data source. In fact, I don't even get to the print window when I reproduce the issue. It doesn't matter whether you actually print or not.
If you want to try and reproduce it, create a spreadsheet with data you would use for a mail merge. Create a document and use the wizard to create a connection to the spreadsheet. Save the document. Open it again. Create a second document and insert some fields in both documents that pull data from the spreadsheet as if you are creating a mailing envelope or mail merge letter. Save and close the documents, then reload them. Select the printer on the tool bar. It should open the dialog (say yes) and then open the data connection window. When both documents are open the connection will pull data from the spreadsheet. Close one and the connection is no longer available.

I have updated to the latest stable version and reproduced the error twice now.  If you can't reproduce the error, I have no explanation for that. I am able to reproduce it repeatedly. The workaround is to leave both documents open, but there still seems to be an unresolved bug.
Comment 8 Dieter 2023-12-23 19:02:02 UTC
Tested with

Version: 24.2.0.0.beta1 (X86_64) / LibreOffice Community
Build ID: 5f390384195b7264c6e52add9e90a39790285249
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

But I failed to test (perhaps I'm not familiar enough with mail merge)

My steps:
1. Download attachment 179145 [details]
2. Open attachment 179147 [details] (envelope.odt) and attachment 179148 [details] (member letter.odt)
3. In document "member letter" Strg+P => Message "Your document contains address database fields. Do you want to print a form letter?"
4. Yes => Message "The file file:///C:/Users/Downloads/memberlist.csv could not be loaded. at C:/cygwin64/home/buildslave/source/libo-core/connectivity/source/commontools/dbexception.cxx:403"
5. ?????

David can you add the correct steps?
Comment 9 David 2023-12-23 21:04:31 UTC
Created attachment 191579 [details]
A writer document detailing how I set up and use the mail merge function.

I have recently updated the documents I use with the mail merge function.  Do you want new files?  How can I send multiple files to you?
Comment 10 Buovjaga 2023-12-24 07:04:45 UTC
(In reply to David from comment #9)
> Created attachment 191579 [details]
> A writer document detailing how I set up and use the mail merge function.
> 
> I have recently updated the documents I use with the mail merge function. 
> Do you want new files?  How can I send multiple files to you?

You attach multiple files one by one.
Comment 11 David 2023-12-24 15:15:15 UTC
Created attachment 191585 [details]
file that uses mail merge
Comment 12 David 2023-12-24 15:15:59 UTC
Created attachment 191586 [details]
file that uses mail merge
Comment 13 David 2023-12-24 15:18:33 UTC
Created attachment 191587 [details]
a file that uses mail merge
Comment 14 Dieter 2024-06-16 13:18:44 UTC
David, sorry for my late replay.

Some remarks to your very detailed description in attachment 191579 [details]:

I couldn't find the attachment with "memberlistfull.csv"; attachment 179145 [details] is "memberlist.csv". Therefore settings for User1 ("organization") and User2 (Address2) are not possible

It's not possible to "open the database maintenance page found at
 https://chippewacountyshootingassociation.com/db/index.php and click on 'Download membership report'.  When the download page loads, click on 'Download Membership File'."

So I failed to follow your instructions, but pershaps it's only, because I'm not very familiar with databases.

Perhaps somebody else can help.



























11.  Click OK. 
12. Make sure the Address book data source is “Addresses”.  If the data source is named anything else, you’ll need to remove the data source (see the section called “Remove a data source”)  Click on Finish.  If asked, choose Yes to overwrite the existing file.

To print cards, letters, and envelopes:

1. Open your downloads folder and delete the “memberlistfull.csv” file if it exists.
2. Open the database maintenance page found at

https://chippewacountyshootingassociation.com/db/index.php

and click on “Download membership report”.  When the download page loads, click on “Download Membership File”.

You should download each time before printing to allow for updates to the database.



3. Open “memberlistfull.csv.  Turn on ‘Autofilter’.  Filter out records with ‘Date Paid’ =”0000-00-00”. Filter out records where ‘Date Printed’ does not equal “0000-00-00”.  Copy all remaining records including column names.  Open “memberlist.csv”.  Clear out any records including the column headers.  Paste into “memberlist.csv” the filtered records from “memberlistfull.csv”.  Save as a csv format file.

 
















4. Verify the database has been updated to reflect all printed records by reviewing the “Active Members” list on the website and comparing it to the “memberlist.csv” file.  If the spreadsheet has records that show as unprinted on the “Active Members” list, update the database and return to step 1 in this section.
5. Open “memberlist.csv” and delete all existing records including the column heading row.
6. Paste the filtered records (including the column heading row) into “memberlist.csv”.
7. Close “memberlistfull.csv”.
8. Save “memberlist.csv” and overwrite the existing file if asked.
9. Open the file for the material you want to print:
	“card front.odt” will print data from the membership.csv file.  Prints 10 at a time.
	“card back.odt” to print the backs of all cards.  Also prints 10 at a time.
	“member letter.odt” to print membership letters.
	“envelope.odt” to print envelopes.

10. If needed, update any text on the card or letter you opened in Writer.  When updating the card, make the changes on the upper left card only.  When complete, click on “Synchronize labels” in the small window.  The changes will be pushed to the remaining cards.  Avoid making changes that affect the layout of the card format since that may cause the cards to print improperly.
11. If you don’t have 10 records in the “membership.csv” file, there will be cards printed without member information listed.  These can be saved and used when one or two memberships are being prepared.

The following steps are the same regardless of the materials being printed:

1. Click on File, Print.  Click on Yes when asked about printing a form letter.
2. In the Mail Merge dialog, make sure the recordset displayed is the correct one.  If there are no records shown, try clicking on the memberlist table in the left pane.  Click OK.
3. On occasion, the data source may not be found.  In this situation, close and reopen Writer and start from step 7.  In rare cases you will need to reestablish the data connection.  Section 1 has instructions.
4. The Print dialog will open. 
5. Choose the printer, click on Print and away you go.

If you need to remove a data source:

1. In Writer, click on Tools, Options.
2. Expand LibreOffice Base and select Databases.
3. Select the data source you want to remove and click on Delete.