Bug 128513 - no linefeeds when importing Calc tables that contain multiline text
Summary: no linefeeds when importing Calc tables that contain multiline text
Status: RESOLVED DUPLICATE of bug 119928
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.3.2.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 143005 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-31 16:22 UTC by racoon
Modified: 2021-08-19 13:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
simple table and database file (9.94 KB, application/x-7z-compressed)
2020-06-01 19:42 UTC, racoon
Details
Solution import from Calc with linebreak by macro (21.30 KB, application/zip)
2020-07-31 14:38 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description racoon 2019-10-31 16:22:50 UTC
Description:
I have problems to import multiline text from Calc, because line feed (LF) is removed (Firebird and HSQLDB mode). Sorry that I don't know the LibreOffice version that breaks this functionality. And I don't know any workarounds.


Steps to Reproduce:
1. use Calc to create rows containing multiline text fields (hint: shift + return in input box)
2. import rows to Base with copy&paste and attach data to existing Base table
3. look in form object containing multiline textbox if linefeeds exist

Actual Results:
no LF, text is continuous

Expected Results:
a lot of LF ;)


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Robert Großkopf 2019-10-31 16:32:51 UTC
I have tested it - and doesn't found any problem.
Do you use the datatype Memo (LONGVARCHAR in HSQLDB, BLOB in Firebird)? Only this datatype will show returns.
Comment 2 racoon 2019-10-31 17:38:44 UTC
I use varchar[8000] in Firebird.

I know it shows no LF directly in the table view, but in a text box in a form object.
Please notice that it works, when I import from another Base table. I'm sorry I did not mention it.

I've been using the database for several years, originally in HSQLDB format, then converted to Fireboard. LF also converted. ;)

So I should use BLOB instead?
Comment 3 racoon 2019-10-31 18:17:12 UTC
I have now used a CLOB [BLOB]. But linefeeds are still removed when importing or appending data by using copy&paste rows from a Calc table. Because I'm using Windows 10, there may seem to be a problem with Unix (LF) and Windows (CR/LF)?
Comment 4 Robert Großkopf 2019-10-31 19:00:18 UTC
(In reply to racoon from comment #3)
> I have now used a CLOB [BLOB]. But linefeeds are still removed when
> importing or appending data by using copy&paste rows from a Calc table.
> Because I'm using Windows 10, there may seem to be a problem with Unix (LF)
> and Windows (CR/LF)?

Have tested the same now: CLOB and LO 6.3.2.2, but OpenSUSE 15 Linux 64bit rpm.
I copy content of Calc to a Base form. Linefeeds appear as expected. There is no difference when setting the properties of the formcontrol to CR+LF(Windows) or LF(Unix). Both will work here.

So it seems to be a special Windows-bug ...
Comment 5 racoon 2019-11-04 19:34:19 UTC
(In reply to Robert Großkopf from comment #4)
> So it seems to be a special Windows-bug ...

Meanwhile I have also tested it on my Kubuntu 19.10 (amd64) Linux system and have the same issue.
Comment 6 Alex Thurgood 2019-11-08 10:31:54 UTC
Works for me too with :

Version: 6.3.1.2
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
Threads CPU : 4; OS : Mac OS X 10.15.1; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded


In the table definition, provide a CLOB field.
Copy the multiline data from a Calc sheet.

Save the record. In the table edit mode, the multiline data is stored with line feeds included.

Create a form based on the table, e.g. using the wizard.
Save the form, then re-open for editing.
Change the default properties of the Text control by choosing "Text type : Multiline" - save the changes
Re-open form in data entry mode - form displays multiline feed text.

WFM
Comment 7 Alex Thurgood 2019-11-08 10:32:33 UTC
(In reply to Alex Thurgood from comment #6)
> Works for me too with :
> 

> 
> In the table definition, provide a CLOB field.
> Copy the multiline data from a Calc sheet.
> 


Firebird was used as the db engine.
Comment 8 racoon 2019-11-08 13:21:33 UTC
This is very strange.

For me it does not work with Windows 10 (version 1903) and Kubuntu (version 19.10,). I have now made a sample video.

https://youtu.be/Ev4T3ef_jEc

In the meantime, I have found a workaround by inserting the Calc table as HTML in Writer and then transfering it with copy and paste to Base.
Comment 9 Xisco Faulí 2020-05-11 07:35:54 UTC
Hello,
A new major release of LibreOffice is available since this bug was reported.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-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.
Comment 10 racoon 2020-05-11 09:37:13 UTC
Still exists in 6.4.3...

The problem will probably not solve itself.
Comment 11 Xisco Faulí 2020-05-11 09:40:27 UTC
(In reply to racoon from comment #10)
> Still exists in 6.4.3...
> 
> The problem will probably not solve itself.

Could you please paste the info from Help - about LibreOffice ?

OTOH, to be certain the reported issue is not related to corruption in the user profile, could you please reset your Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and re-test?

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the issue is still present
Comment 12 racoon 2020-05-11 10:40:41 UTC
Windows:

Version: 6.4.3.2 (x64)
Build-ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8
CPU-Threads: 4; BS: Windows 10.0 Build 18363; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL

Linux:

Version: 6.4.3.2
Build ID: 1:6.4.3-0ubuntu0.20.04.1
CPU threads: 2; BS: Linux 5.4; UI-Render: Standard; VCL: kf5; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded


I reset the profile, but the line feeds imported from Calc are still dropped - both Windows and Linux.
Comment 13 racoon 2020-06-01 11:30:46 UTC
Will LibreOffice Base be further developed?

Version 6.4.4.2 and 7.0.0.0-alpha1 still have the bug...
Comment 14 Robert Großkopf 2020-06-01 18:59:10 UTC
(In reply to racoon from comment #13)
> Will LibreOffice Base be further developed?
> 
> Version 6.4.4.2 and 7.0.0.0-alpha1 still have the bug...

This bug is unconfirmed from any other person. So nobody, who could resolve bugs, has a chance to find the buggy behavior.

Firebird is set back to "experimental", because there are too many things, which will work better with internal HSQLDB. Please test the behavior with internal HSQLDB and upload an example as attachment here. This will be the best possibility to see the problem for other people.
Comment 15 racoon 2020-06-01 19:42:06 UTC
Created attachment 161505 [details]
simple table and database file
Comment 16 racoon 2020-06-01 19:44:07 UTC
(In reply to Robert Großkopf from comment #14)
> 
> This bug is unconfirmed from any other person. So nobody, who could resolve
> bugs, has a chance to find the buggy behavior.

So the bug will still be there in a few years because only a few users use LibreOffice Base? Please look at my video so you can confirm this behaviour.

> Firebird is set back to "experimental", because there are too many things,
> which will work better with internal HSQLDB. Please test the behavior with
> internal HSQLDB and upload an example as attachment here. This will be the
> best possibility to see the problem for other people.

HSQLDB has the same problem. Example is attached...
Comment 17 Robert Großkopf 2020-06-02 08:44:25 UTC
With the attached database and Calc-file I could reproduce the behavior.
Tested with OpenSUSE 15.1 64bit rpm Linux and different LO-Versions (LO 6.4.4.2, also LO 6.1.5.2 ...)

I don't know why it worked here before.
Comment 18 Robert Großkopf 2020-07-31 14:38:52 UTC
Created attachment 163814 [details]
Solution import from Calc with linebreak by macro

I have tried it again for another user. Then In remembered I had written a macro for this. Is all in German, but it works.

See the attached *.zip-folder. There is a database and a Calc file.
The Calc file must have this name for the macro - or must be renamed in the macro. The Calc file must be in the same folder as the Base file.

Activate macros for the database.
Open the form.
Press the button.
Content of the textboxes will be imported with linebreaks.

The macro is set to read all data except data for the field "ID".
Comment 19 Robert Großkopf 2020-07-31 14:57:20 UTC Comment hidden (obsolete)
Comment 20 Timur 2021-08-17 14:58:01 UTC
*** Bug 143005 has been marked as a duplicate of this bug. ***
Comment 21 Timur 2021-08-17 15:23:05 UTC
This seems like a duplicate of bug 119928.
Please verify with testing LO 5.4.7 which didn't have it.

*** This bug has been marked as a duplicate of bug 119928 ***
Comment 22 Silvain Dupertuis 2021-08-17 16:03:31 UTC Comment hidden (obsolete)
Comment 23 Timur 2021-08-17 16:10:58 UTC Comment hidden (obsolete)
Comment 24 Silvain Dupertuis 2021-08-17 16:36:59 UTC
Sorry I only have the latest versions of LibreOffice
What I tested :
- Having a calc file with multiline cells
- Creating a fresh database with the option «connect to an existing database»
- Chose the calc file as this existing database.
- The sheets appear as tables, but the line-breaks are lost.

What I would expect is having linebreaks preserved in both directions when exchanging data between calc and base.

One thing I am doing on a regular bases is updating a mysql database for a web-based application from my local Base file. I use a Calc file, connect it with my registered database, copy the desired tables and/or querys, then copy the whole calc file into the mysql database. It works fine and fast, except for line-breaks in some multiline fields...

Sorry if the terminology is not exact, I speak French and use a French interface in my installation.
Comment 25 Robert Großkopf 2021-08-17 18:07:28 UTC
(In reply to Silvain Dupertuis from comment #22)
> (In reply to Robert Großkopf from comment #19)
> > And a second very simple solution:
> > Set the Calc file as datasource of a new *.odb-file.
> > Copy the content from the Calc-database-file to your database.
> > Linebreaks will be imported to the internal database.
> 
> I tested this and it does not work.
> Line-breaks are lost if I create a fresh database and connect to the example
> calc file as datasource

This isn't what I described:
1. You need a Calc document with fields, which may have also linebreaks.
2. You need a first database, which only connects to Calc.
3. You need a second database, to which you will copy the content with the linebreaks. The fields for the table must be datatype Memo (LONGVARCHAR in HSQLDB, BLOB in Firebird). The linebreaks will be shown in the second database.
Comment 26 Timur 2021-08-18 07:16:10 UTC
(In reply to Timur from comment #23)
> I duplicated this under the assumption that culprit is source Calc and not
> destination Base. Please confirm by testing version up to 5.4.7

(In reply to Silvain Dupertuis from comment #24)
> Sorry I only have the latest versions of LibreOffice

In Windows, there's only one regular installation and master version can be installed separately, keeping regular installation.
In order to test older version, one can use http://tdf.io/siguiexe to download and "install" any version, which is really not installed but extracted and run via shortcut.
Comment 27 Silvain Dupertuis 2021-08-19 12:16:42 UTC
(In reply to Robert Großkopf from comment #25)
> (In reply to Silvain Dupertuis from comment #22)
> > (In reply to Robert Großkopf from comment #19)
> > > And a second very simple solution:
> > > Set the Calc file as datasource of a new *.odb-file.
> > > Copy the content from the Calc-database-file to your database.
> > > Linebreaks will be imported to the internal database.
> > 
> > I tested this and it does not work.
> > Line-breaks are lost if I create a fresh database and connect to the example
> > calc file as datasource
> 
> This isn't what I described:
> 1. You need a Calc document with fields, which may have also linebreaks.
> 2. You need a first database, which only connects to Calc.
> 3. You need a second database, to which you will copy the content with the
> linebreaks. The fields for the table must be datatype Memo (LONGVARCHAR in
> HSQLDB, BLOB in Firebird). The linebreaks will be shown in the second
> database.

This is what I tested : 
the example calc document has fields with line-breaks
I created a fresh database connected at this calc document as it's database source and examined the table corresponding to the test sheet
As the line-fields were lost in this database, I did not even try to copy the data into another database.
Comment 28 Robert Großkopf 2021-08-19 13:58:26 UTC
(In reply to Silvain Dupertuis from comment #27)
> 
> This is what I tested : 
> the example calc document has fields with line-breaks
> I created a fresh database connected at this calc document as it's database
> source and examined the table corresponding to the test sheet
> As the line-fields were lost in this database, I did not even try to copy
> the data into another database.

The linefeed weren't shown in the database, which is linked to Calc.
The last step (copy to a new HSQLDB or Firebird database with fields, which could show the linefeed) is missed here.