Problem/Motivation

Cells with multi-line text show in one row which makes spreadsheets hard to read.

Steps to reproduce

Create a view with multi-line content (WYSIWYG content for example)
Export results in XLSX

Proposed resolution

Adjust code to enable wrapping and auto-height for the row.

Something like

    foreach($sheet->getRowDimensions() as $row_id) { 
      $row_id->setRowHeight(-1); 
    }
    $sheet->getStyle('A1:' . implode('', $sheet->getHighestRowAndColumn()))->getAlignment()->setWrapText(true);

Remaining tasks

N/A

User interface changes

No changes, so far. Though, it might be a good idea to make it configurable.

API changes

No changes, so far

CommentFileSizeAuthor
#5 3224446-5.patch1.5 KBspelcheck
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Alex Liannoy created an issue. See original summary.

alex liannoy’s picture

Status: Active » Needs review

Created initial patch which adds the requested feature.
Without an interface, but functioning.

kepesv’s picture

I can confirm that patch is working

spelcheck’s picture

StatusFileSize
new1.5 KB

Confirmed working.

I needed this as a simple patch for our composer workflow, created against 1.x-dev for anyone in our position.

  • theemstra committed d20b8905 on 8.x-1.x
    Add auto-height and text wrapping for rows
    Closes #3224446 (Closes MR !...

theemstra’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.