Bug 384493

Summary: Exporting a query to the clipboard divides the content of a field
Product: [Applications] KEXI Reporter: Albrecht Will <albrecht.will>
Component: Migration/Import/ExportAssignee: Kexi Bugs <kexi-bugs>
Status: CLOSED WORKSFORME    
Severity: normal CC: adam, inksi, staniek
Priority: NOR    
Version: 3.0.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot from form
screenshot from calc
over clipboard
directly csv
Expected options

Description Albrecht Will 2017-09-08 14:27:04 UTC
Created attachment 107750 [details]
screenshot from form

The content of a field from type
"a) text 1 (linebreake) b) text 2"
will be devided. The linebreake starts a new sentence in calligra writer or Libre Office.
Exporting to a csv-file the linebreake appears in the desired cell.
Comment 1 Albrecht Will 2017-09-08 14:28:07 UTC
Created attachment 107751 [details]
screenshot from calc
Comment 2 Jarosław Staniek 2017-09-08 14:32:49 UTC
Thanks Albrecht, could you please paste the content to a .txt file and attach it too?
Comment 3 Albrecht Will 2017-09-08 14:44:17 UTC
Created attachment 107752 [details]
over clipboard
Comment 4 Albrecht Will 2017-09-08 14:45:02 UTC
Created attachment 107753 [details]
directly csv
Comment 5 Jarosław Staniek 2017-09-08 15:25:24 UTC
Libre office and Excel (and probably many other apps) expect tab delimiters and " quotes for clipboard CSV format.
Comment 6 Jarosław Staniek 2017-09-08 15:26:05 UTC
Created attachment 107756 [details]
Expected options
Comment 7 Jarosław Staniek 2017-09-08 15:28:24 UTC
I am not sure the format is invalid because " character is used which protects against issues when newline character is used. It works with Excel and LibreOffice but if you import via file. It is invalid for clipboard as mentioned above.

Side note for myself: Let's look what are our default options for clipboard handling. It's not best thing that we don't warn if user changes them in case of clipboard.
Comment 8 Jarosław Staniek 2017-09-08 15:30:55 UTC
So summing up, the content https://bugs.kde.org/attachment.cgi?id=107752&action=edit is almost OK except it contains no quotations, what is exactly the reason why applications can't detect the value contains new line.

When I have " quotations set in the options, relevant fragment of the csv is:

"a) Tabakwarenhandlung
b) Schankwirtschaft """Centralhotel"""
Comment 9 Albrecht Will 2017-09-08 15:50:54 UTC
Ok I understand the use of quotations.
If its not too hard, what about changing a break within a db-cell into a space. When you EXPORT a db-content then such formal things ar not essentially. Look at my attachment out off my form. I used it there for a better presentation.
But this is only my actual limited perception.
Comment 10 Jarosław Staniek 2017-09-08 18:11:56 UTC
Does the paste to LO work for you if you use " and tabs?
Comment 11 Albrecht Will 2017-09-08 18:41:09 UTC
Thanks, it works well! - a much easier way, but you should know.
Comment 12 Jarosław Staniek 2017-09-08 19:10:42 UTC
OK then, so I would see these conclusions that can lead to improvements:

- warn the user about unsafe settings for clipboard content
- add a checkbox that for sets clipboard-safe content
- add option to replace newlines with spaces in cell values on export

These would be separate tickets that I can add.

Thanks Albrecht.