Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 374643 - Copy/paste from table into Excel: Line breaks result in extra cells
Summary: Copy/paste from table into Excel: Line breaks result in extra cells
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andre Lohrenz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-19 08:47 EDT by Andre Lohrenz CLA
Modified: 2021-08-19 11:04 EDT (History)
1 user (show)

See Also:
zimmermann: juno+


Attachments
Each line of text gets its own cell. (3.18 KB, image/png)
2012-03-19 08:47 EDT, Andre Lohrenz CLA
no flags Details
Proposed patch. (1.17 KB, patch)
2012-03-19 08:47 EDT, Andre Lohrenz CLA
hannes.mueller: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Lohrenz CLA 2012-03-19 08:47:17 EDT
Created attachment 212848 [details]
Each line of text gets its own cell.

- Select some rows in a table and press CRTL-C to copy them to the clipboard.
- Paste them into a Microsoft Excel spread sheet.
- Cells that contain text with line breaks in them are split into one cell for each line of text. These cells belong to "sub rows" of the corresponding row for the Scout table row (see screenshot). Mostly, this is not desired. You rather want all the lines in the same cell, but with line breaks between them.

Error applies at least to Excel 2010.

Analysis: Excel gets its information from the HTML part that is created from the Scout table content when CTRL-C is pressed. Line breaks within cells are translated to "br" HTML tags, which result in the extra cells.

Proposed solution: Internet research indicates that Excel tags can be advised to process the "br" tags as normal line breaks and not create extra cells by adding a style information ("mso-data-placement:same-cell;") to the "br" tag. The attached patch adds this style definition to the "head" section of the HTML generated by the copy procedure in AbstractTable. This works for me.
Comment 1 Andre Lohrenz CLA 2012-03-19 08:47:45 EDT
Created attachment 212849 [details]
Proposed patch.
Comment 2 Hannes Mueller CLA 2012-04-02 03:15:02 EDT
Patch applied, please re-test
Comment 3 Hannes Mueller CLA 2012-04-04 01:40:16 EDT
ip-flag checked
Comment 4 Matthias Zimmermann CLA 2012-07-09 06:50:24 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)