Bug 61329 - Pasting Data Only (not formatting) from Calc into Table in Writer Impossible
Summary: Pasting Data Only (not formatting) from Calc into Table in Writer Impossible
Status: RESOLVED DUPLICATE of bug 37223
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-23 08:03 UTC by kaesezeh
Modified: 2014-02-26 01:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Input spreadsheet (8.60 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-02-25 16:27 UTC, kaesezeh
Details
Output odt with crap table (23.59 KB, application/vnd.oasis.opendocument.text)
2013-02-25 16:27 UTC, kaesezeh
Details
Good Table (14.86 KB, application/vnd.oasis.opendocument.text)
2013-02-26 02:08 UTC, Joel Madero
Details
Good table, new: intended output (18.69 KB, application/vnd.oasis.opendocument.text)
2013-02-26 18:51 UTC, kaesezeh
Details
Copy Paste Table from Excel to Word (11.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-02-26 19:24 UTC, Joel Madero
Details
step 1 (65.42 KB, image/png)
2013-03-02 00:03 UTC, kaesezeh
Details
step 2 (68.50 KB, image/png)
2013-03-02 00:03 UTC, kaesezeh
Details
step 3: result (68.49 KB, image/png)
2013-03-02 00:04 UTC, kaesezeh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kaesezeh 2013-02-23 08:03:23 UTC
In Office, one can just copy and paste stuff from Excel tables into tables in Word and get it all nice very easily - why can't we have that in LibreOffice? The simplest strategy - copying from Calc, pasting into Writer as text, then in Writer do Text->Tables - is just convoluted and loses all formatting ... There MUST be a better solution!
Comment 1 Joel Madero 2013-02-23 21:34:10 UTC
We need you to be much more specific about what the issues are, also please be more descriptive in your bug titles. 

"it's broken" isn't enough for anyone to a) triage the bug or b) someone to fix the bug

Also please only put one issue per bug, even if they are related make new bugs. Marking as NEEDINFO.

If you can identify ONE issue, write out reproducible steps, attach a test document, and update the title to mean something more than what is currently there please open as UNCONFIRMED and I'll take a look.
Comment 2 kaesezeh 2013-02-25 16:27:05 UTC
Created attachment 75512 [details]
Input spreadsheet
Comment 3 kaesezeh 2013-02-25 16:27:29 UTC
Created attachment 75513 [details]
Output odt with crap table
Comment 4 kaesezeh 2013-02-25 16:28:22 UTC
> We need you to be much more specific about what the issues are
Well, the issue is it's a pain in the ass, I was very specific. I never said it's broken, just that it's badly implemented, and the knee-jerk reaction of "we need more info" doesn't help especially when all that is needed is 5 seconds of just trying what I describe

- an empty odt
- an ods with any content.

But, I now attach two documents so that anyone can experience the joy. Just copy the table part from the ods and try to paste it into the odt: what is intuitive and easy in Office doesn't work here at all, neither with just paste or with any option of paste special.
Comment 5 Joel Madero 2013-02-26 02:04:15 UTC
That's all we neede, I've triaged over a 100 bugs this week, I don't have time to "guess" what you mean. Thanks for the attachments
Comment 6 Joel Madero 2013-02-26 02:05:13 UTC
Also please don't swear in FDO, it's against policy
Comment 7 Joel Madero 2013-02-26 02:07:35 UTC
So following your two steps, I see no issue, attached is an empty document that I pasted the table that you so pleasantly provided for us. As you can see it looks perfect so, your steps seem incomplete
Comment 8 Joel Madero 2013-02-26 02:08:36 UTC
Created attachment 75539 [details]
Good Table
Comment 9 Joel Madero 2013-02-26 02:14:58 UTC
Sorry for the spamming but - are you saying you're trying to copy a table from calc into another table within writer ? In other words these steps:

1. Create table in Calc

2. Create table in Writer

3. Copy table from Calc in it's entirety

4. Paste table into writer table within 1 cell of that table?

otherwise I have no clue why you'd copy/paste a table within a table. You just have to copy the table from calc and simply paste it (not within a table) within writer

Again, this is why we ask for step by steps as I've now wasted 5-10 minutes guessing at what you did - I see your document is screwed up but those don't follow your instructions at all - ie. not a blank document that you simply copied and pasted a table from calc into writer
Comment 10 kaesezeh 2013-02-26 18:51:02 UTC
Point taken. Yes, I am trying to insert a table from Calc into a table from Writer and I know that just pasting the table from Calc into Writer works. The reason for wanting to insert a table from Calc into a table from Writer is that if you just paste a table from Calc into Writer, then it (of course) adopts all the settings from Calc such as the table/column widths(s), row heights etc. However, in my field at least, articles involve tables that span the whole width of the page and have the otherwise used document fonts, font sizes, ... Thus, in Word, I can simply generate an empty table and copy into it data from Excel and the pasting process takes care of the mapping which cell of the Excel table needs to go into which cell of the Word table. I attach an example of intended output.
Comment 11 kaesezeh 2013-02-26 18:51:38 UTC
Created attachment 75596 [details]
Good table, new: intended output
Comment 12 Joel Madero 2013-02-26 18:52:24 UTC
Testing now, going to compare MSO to LibreOffice to see difference, thanks for additional info
Comment 13 Joel Madero 2013-02-26 19:16:25 UTC
@kaesezeh - are you comfortable adding my gmail to your chat? I am still not seeing this but really want to figure it out as I now completely understand what you're saying :-D I just want to be 100% sure that I'm doing things right. 

My notes are that in MSO when I copy from Excel to a table in Word I don't get behavior you are describing, everything copies (including formatting) into a single cell of the table in MSO Word. This doesn't seem like it is what you're describing
Comment 14 Joel Madero 2013-02-26 19:24:17 UTC
Created attachment 75597 [details]
Copy Paste Table from Excel to Word

Here is what I see with a simple copy paste of a table from excel to word - open this with MSO and tell me if it's what you expect (I don't think it is).
Comment 15 kaesezeh 2013-03-02 00:03:03 UTC
Hi

Ok, I did a bad job at describing this. When you paste into Word, you have to highlight (a part of) the table that will take the content but then it works

- attachment <1.png>: creating Excel content with formatting
- attachment <2.png>: highlighting an equally-dimensioned table in Word
- attachment <3.png>: the result of pasting: nice with all formatting

Sorry, should have been clearer; it's all so automatic in Excel/Office I didn't retrace my steps well
Comment 16 kaesezeh 2013-03-02 00:03:27 UTC
Created attachment 75763 [details]
step 1
Comment 17 kaesezeh 2013-03-02 00:03:41 UTC
Created attachment 75764 [details]
step 2
Comment 18 kaesezeh 2013-03-02 00:04:00 UTC
Created attachment 75765 [details]
step 3: result
Comment 19 morvan 2013-04-01 12:05:41 UTC
What I understand from the question is an antique problem with implementation.
In Word, I paste a table from Excel, by example, and it comes default. In Writer, I need Special Paste to Specify whose final format I want. If I simply assign Paste, it comes as a drawing (I can see the tags for manipulation, If I select recently pasted object). Pasted object supposed to be a table (RTF, HTML), primarily, i. e., as default?
Several clients at my work make this mistake (paste content and receive not exactly what they expected. Frustrating for them and for me, cause I have difficult to explicate - technically what happens).
Sincerely,

Morvan
Comment 20 Joel Madero 2013-04-16 18:49:16 UTC
Okay I can finally confirm this behavior.

To Reproduce:

1. Open calc and writer
2. In calc, put some text in A1, A2, B1, B2 (anything works)
3. Switch to writer
4. Create a 2x2 table (insert - table)
5. Try to paste the table INFO (only the information) into the table of writer - leaving the formatting of the table writer untouched.

in other words:
You'll see that the table spans the entire width of the page - let's say this is desired

Now let's say what you want the following situation:

Paste the information from Calc into the table in writer without changing the formatting at all of writer - ie you want just the data (nothing else) copied from calc into the table that spans the entire width in writer.

From what I can tell, this is impossible, no special paste works correctly, pasting regular doesn't work (as it shouldn't, special paste is what we need to work correctly). 

If anyone can do this, please write out detailed steps, as far as I can tell, you cannot accomplish this easily in LibreOffice.


Changing title & version (verified on 3.6.5.2, version is oldest not newest place where we test the issue) marking as:

New (confirmed)
Normal - can prevent high quality work
Medium - default, think this is appropriate

The reason why I put this as a bug and not as an enhancement is that one would think logically Special Paste -> Unformated Text would paste the information into the table correctly but it unfortunately does not, you'll see that everything ends up in A1 of the writer table. If someone copies a 2x2 table from calc and pastes the info unformatted into a 2x2 table in writer, you would think the data would match up - I think this is the expectation but probably quite difficult to accomplish.


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage and join us on freenode at #libreoffice-qa

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 21 poky 2013-05-29 16:50:21 UTC
It is very old issue, perhaps from OpenOffice 1.1.
I voted for this bug nr. 24500 in OpenOffice and it has 108 votes now.
For LibreOffice it is possible duplication Bug 37223.
Comment 22 poky 2013-05-30 11:45:24 UTC
This opensource extension can help: http://extensions.services.openoffice.org/en/project/pasteasvalue

This extension (macro)writed Mr. J. Pastierik and sent me it under GNU General Public License.
Internet page: http://www.inet.sk/clanok/5845/makra-v-openoffice-org-02-2008:

global cells_from_calc_to_writer(0,0)
global column_from_calc_to_writer, lines_from_calc_to_writer as long

sub Copy_table_from_Calc_to_Writer
 dim dokument, cell as object
 dim column, line as long
 dim message as string

 if ThisComponent.supportsService("com.sun.star.sheet.SpreadsheetDocument") then
  Dokument=ThisComponent.getCurrentSelection()
  column_from_calc_to_writer=dokument.getcolumns().Count
  lines_from_calc_to_writer=dokument.getrows().Count

  if column_from_calc_to_writer<>0 and lines_from_calc_to_writer<>0 then
   redim preserve cells_from_calc_to_writer(lines_from_calc_to_writer, column_from_calc_to_writer)

   for column=0 to column_from_calc_to_writer-1
    for line=0 to lines_from_calc_to_writer-1
     cell=dokument.getCellByPosition(column, line)
     cells_from_calc_to_writer(line+1, column+1)=cell.getstring()
    next line
   next column
  endif
  message="Copied"+str(column_from_calc_to_writer)+" column and "+str(lines_from_calc_to_writer)+" lines"
  msgbox message
 endif
end sub

sub Create_table_from_Calc_to_Writer
 dim dokument, cursor, table, cell as object
 dim column, line, shift_column, shift_line as long
 dim adress as string

 if ThisComponent.supportsService("com.sun.star.text.TextDocument") and _
  column_from_calc_to_writer<>0 and lines_from_calc_to_writer<>0 then
  dokument=StarDesktop.CurrentComponent
  cursor=ThisComponent.currentcontroller.getViewCursor()

  on error goto We_are_not_in_the_table

  table=cursor.TextTable

  adress=cursor.Cell.CellName
  shift_column=asc(left(adress, 1))-65
  shift_line=val(right(adress, len(adress)-1))-1
  
  wehave_table:
  on error resume next

  for line=1 to lines_from_calc_to_writer
   for column=1 to column_from_calc_to_writer
    adress=chr(64+column+shift_column)&(line+shift_line)
    cell=table.getCellByName(adress)
    cell.String= cells_from_calc_to_writer(line, column)
   next column
  next line
 else
  msgbox "In the mailbox is not table"
 endif

 exit sub

 We_are_not_in_the_table:
  table=dokument.createInstance("com.sun.star.text.TextTable")
  table.initialize(lines_from_calc_to_writer, column_from_calc_to_writer)
  dokument.Text.insertTextContent(cursor, table, false)
  goto wehave_table
end sub
Comment 23 poky 2013-05-30 12:21:08 UTC
I'm sorry about last message - macro is not under GNU General Public License.
Internet page: http://www.inet.sk/clanok/5845/makra-v-openoffice-org-02-2008.
Comment 24 sunweb 2013-10-10 10:55:23 UTC
Yup, the same problem.


Problem description: 
Can't properly paste the table contents from Calc to table in Writer

Steps to reproduce:
1. open Calc and fill data in A1 and B1 cells.
2. select both cells and copy them
3. open Writer and create the table with 2 columns
4. select both cells and paste special "unformatted text"

Current behavior:
pastes data in the first cell and symbols in the second

Expected behavior:
pastes data from A1 to the first cell and B1 to the next cell

Select 1 cell and paste 2 cells copied from Calc in this very cell = ok
Select 2 cells and paste 2 cells copied from Calc in one cell = not ok
Select 2 cells and paste 2 cells copied from Calc in two cells = ok

----------------------

Another not top priority but useful feature is used with the one i desribed. When you pasted more data from Calc to Writer in which table is too small you have a 1 click option to create additional table cells already filled with your data.
Comment 25 sunweb 2013-10-10 11:14:10 UTC
This is strange, this bug exists for so long yet noone really cares? I understand that its not a crash or anything but it still very annoying. Most of people work with Writer and Calc, so it must have priority comparing to anything else. On first sight everything works fine but as they say "devil is in details" and this is one of them.
Comment 26 Timur 2014-02-03 10:21:23 UTC
I suggest this be marked as a duplicate of Bug 37223 and then Bug 37223 be added to MAB.
Comment 27 Joel Madero 2014-02-26 01:57:18 UTC
Yes I believe they are dupes, marking this one as such and I'll try to find someone to tackle the other one. Good to know that it's been around since OOo days - updating version on the other one to reflect this

*** This bug has been marked as a duplicate of bug 37223 ***