Bug 51918 - : Copying from Base table to Spreadsheet alphabetizes and misaligns headers
Summary: : Copying from Base table to Spreadsheet alphabetizes and misaligns headers
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-09 15:22 UTC by benjamin_lichtner
Modified: 2015-01-04 13:19 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Database (odb) file (438.65 KB, application/vnd.oasis.opendocument.database)
2012-08-30 15:40 UTC, Tony Pursell
Details
Calc file showing formatting problems (30.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-08-30 15:43 UTC, Tony Pursell
Details
Screen shot of the Format Cells dialogue (50.88 KB, image/png)
2012-08-30 15:44 UTC, Tony Pursell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benjamin_lichtner 2012-07-09 15:22:36 UTC
Problem description: 

After reading how to export data from Base (http://help.libreoffice.org/Common/Importing_and_Exporting_Data_in_Base), I attempted to follow the steps to export a csv. I copied the data from a table in my database and pasted it into a new spreadsheet, but the header row was completely alphabetized (and thus misaligned), and each header name occupied more than a single column.

Steps to reproduce:
1. Import an mdb or accdb file into Base
2. Open a table
3. Copy the table
4. Open a new spreadsheet
5. Paste into the spreadsheet

Current behavior:
Elements of the header row are alphabetized and occupy more than one column. Thus they are not properly aligned with each column of data.

Expected behavior:
Each element of the header row is properly aligned with the corresponding data column.

Platform (if different from the browser):
Windows 7
Comment 1 Robert Großkopf 2012-07-13 14:26:11 UTC
I can't reproduce it. Have no mdb- or accdb-file. Could you please declare it with an attachment (*.odb-file and screenshot of *.odt-file)?
Comment 2 benjamin_lichtner 2012-07-14 00:05:27 UTC
Sure. Here's a link to a dropbox folder containing an .odb file, the .accdb
file to which it is linked, and the .ods file into which I pasted one of
the tables.

https://www.dropbox.com/sh/psavwxluly5awpj/Wh_2egYE76

--Benny

On Fri, Jul 13, 2012 at 11:26 PM, <bugzilla-daemon@freedesktop.org> wrote:

> https://bugs.freedesktop.org/show_bug.cgi?id=51918
>
> robert@familiegrosskopf.de changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |
> robert@familiegrosskopf.de
>
> --
> Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
Comment 3 Robert Großkopf 2012-07-14 06:58:31 UTC
The *.odb-file is linked to a database outside the file. I couldn't see any table. I could not open an accdb-file - have no Access here and no Windows.
I can not see which sorting the headers of the table had, before they are imported.
When I take a table from a *.odb-file and paste it to a *.odt-file, the sorting is correct. 
You didn't import the Access-file in *.odb. How do you connect the *.odb-file to the accdb-file?
The header of this bug is misleading. You havn't a Base-table. You have only a look on a table of another database. When you write about Base-table, we would search for the bug only in a *.odb-file, not a linked file to another database. The database of the *.odb-file is HSQLDB.
The problem must be the connection between the accdb-file and LO. There is no possibility to connect to an accdb-file with a standard-LO-installation.
Comment 4 benjamin_lichtner 2012-07-14 07:53:38 UTC
Hi. To create the .odb file that I sent you, all I did was create a new
Base file, select connect to an existing database, select Microsoft 2007,
and select the .accdb file. However, I did need to boot into Windows--the
connection is not possible on OS X. Is there a way to save a new .odb file
after connecting it to another database? Or any other way to make the new
.odb file independent of the .accdb file? I apologize for the misleading
title. I am not familiar with databases.

On Sat, Jul 14, 2012 at 8:58 AM, <bugzilla-daemon@freedesktop.org> wrote:

> https://bugs.freedesktop.org/show_bug.cgi?id=51918
>
> --- Comment #3 from robert@familiegrosskopf.de 2012-07-14 06:58:31 UTC ---
> The *.odb-file is linked to a database outside the file. I couldn't see any
> table. I could not open an accdb-file - have no Access here and no Windows.
> I can not see which sorting the headers of the table had, before they are
> imported.
> When I take a table from a *.odb-file and paste it to a *.odt-file, the
> sorting
> is correct.
> You didn't import the Access-file in *.odb. How do you connect the
> *.odb-file
> to the accdb-file?
> The header of this bug is misleading. You havn't a Base-table. You have
> only a
> look on a table of another database. When you write about Base-table, we
> would
> search for the bug only in a *.odb-file, not a linked file to another
> database.
> The database of the *.odb-file is HSQLDB.
> The problem must be the connection between the accdb-file and LO. There is
> no
> possibility to connect to an accdb-file with a standard-LO-installation.
>
> --
> Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
Comment 5 Robert Großkopf 2012-07-14 09:06:59 UTC
Could be the same way I can import the thunderbird-adressbook, when I want to edit the files:
Open the database with the connection to the *.accdb-file. Create another new database. Click with the right button of the mouse on the table of the old database: copy. Click with the right button on the new database in the folder tables: paste. You are asked something about the types of the fiels. You can also sort the fields. Normally the fields are sorted as in the table of the old database. Try the automatic way. Could be you are asked for a primary-key. There was a key in the *.accdb-file. When you will use the new database not only for testing you must have a primary-key. If you don't know what it is you could also accept, that base creates a new key.
The table would be created by this wizard. Are the fields sorted as they are sorted in the table of the old database?
Now you could import the content in different ways to calc. They must be sorted like they are sorted in the new created database.
After this we will see, which is the right title of this bug and we could say, this is a bug for Windows, not for Linux or Mac (because there is no easy possibility to connect to *.accdb-files).
Comment 6 Tony Pursell 2012-07-29 16:39:53 UTC
I have seen a similar problem copying from Base to Calc.

The table in Base contains 126 columns. When copied and pasted into a Calc spreadsheet, the first 35 data items span 3 columns each, taking up the first 105 spreadsheet columns from A to DA. Then from columns DB to DU there are a further 10 data items spanning 2 columns each. The other 81 data items are correctly allocated 1 column each, taking columns DV to GX.

If correctly allocated the 126 data items take up columns A to DV.

This problem seems to relate to the number of columns copied and pasted.  A table with only a few columns has data items correctly allocated 1 column each.

There is also other mis-formatting with strikethrough and underline formatting being applied to the data items.  This can be corrected using Format > Cells and setting '(Without)' for Strikethrough and Underlining on the Font Effects in place of the blank entries found. This mis-formatting occurs with any size table.

I am using LO version 3.5.4.2 in Ubuntu 12.04LTS
Comment 7 Tony Pursell 2012-08-03 22:11:01 UTC
@benjamin_lichtner

Rather than connecting a Base (odb) file to an Access database, can you export the table to CSV (you used to be able to do do this in the days when I worked with Access mdb files) then copy that into a table in an odb file, then try copying back to Calc?  

If this still causes the problem that you observe, then it is not the connection to the Access database that is the problem, but the copy from Base to Calc (as I have observed.  You will then have a the odb file that you can attach here as a test case.

Tony
Comment 8 Jochen 2012-08-30 08:22:41 UTC
Hi reporter,

it is necessary to make the bugreport reproducible. Please do following:
1) Ceck if object/title of this bugreport is correct
2) List the single steps in details to reproduce your procedure
3) attach database-file and screenshot(s)
Comment 9 Tony Pursell 2012-08-30 15:40:39 UTC
Created attachment 66342 [details]
Database (odb) file
Comment 10 Tony Pursell 2012-08-30 15:43:04 UTC
Created attachment 66343 [details]
Calc file showing formatting problems
Comment 11 Tony Pursell 2012-08-30 15:44:05 UTC
Created attachment 66344 [details]
Screen shot of the Format Cells dialogue
Comment 12 Tony Pursell 2012-08-30 15:55:58 UTC
Hi Jochen

I am not the original reporter (benjamin_lichtner@brown.edu).  I have added myself to this bug as my problems are the same or similar. Please let me know if you would prefer me to create a separate bug report.

This bug was originally reported at https://bugs.launchpad.net/df-libreoffice/+bug/1032094 See that for further details.

I have uploaded three files 

i) A database file LS.odb containing a table Test2
ii) A Calc file copyout2.ods which shows the formatting problems
iii) A screen shot ScreenshotOfFormatCells.png

The file copyout2.ods was created by:-

1) Opening a new Calc document
2) Opening the file LS.odb
3) Selecting Tables
4) Right clicking on Test2 and selecting Copy
5) Switching to the Calc document
6) Copying data with Ctrl-V (cell A1 should be selected)
7) Saving the Calc document as copyout2.ods

Please let me know if you need any more information

Tony
Comment 13 benjamin_lichtner 2012-08-30 17:27:37 UTC
Thanks for taking this on, Tony!
Comment 14 Alex Thurgood 2015-01-03 17:39:47 UTC
Adding self to CC if not already on
Comment 15 Tony Pursell 2015-01-04 12:26:42 UTC
I have retested thus using LO version 4.2.7.2 and Ubuntu 14.04 and it seems to be OK now so I am changing the status to RESOLVED/FIXED.

If any one else still has this problem using 4.2.7.2 or later, please put it back to NEW.
Comment 16 Adolfo Jayme Barrientos 2015-01-04 13:19:25 UTC
(We reserve the FIXED resolution when we know the exact commit that fixed a bug. When a bug becomes obsolete or is not reproducible anymore, we set the WORKSFORME status.)