Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issues with Word2013 and vMerge #368

Open
florinsecal opened this issue Sep 15, 2014 · 1 comment
Open

Compatibility issues with Word2013 and vMerge #368

florinsecal opened this issue Sep 15, 2014 · 1 comment

Comments

@florinsecal
Copy link

florinsecal commented Sep 15, 2014

Hi there,

I have an issue when editing tables with vertical merged cells in docx with Word 2013.

Repro Steps:

  • create a docx document with PHPWord (the table must be on the pages)
  • Use vMerge to merge a few cells
  • Open the document in Word 2013 and edit the part of the table on the 2nd page
  • Notice that:
    1.some of the cells cannot be selected.
    2.if you start editing the content of cells in the table, you will notice that some rows are duplicated
    3.if you save the document (Word asks to use compatibility mode), the cells that are not editable will lose the content

Other editors:

  • Libre Writer 4.3 - PASS
  • Kingsoft Writer 9.1 - PASS
  • Word 2007 - PASS
  • Word 2013 - FAIL

Code sample

test.php

setDefaultFontName('Times New Roman'); $phpWord->setDefaultFontSize(12); $section = $phpWord->addSection(array('orientation'=>'landscape')); $cellStyleMerge = array( 'borderColor' => '000000', 'borderSize' => 6, 'vMerge' => 'restart' ); $cellStyleContinue = array( 'borderColor' => '000000', 'borderSize' => 6, 'vMerge' => 'continue' ); //some text $section->addText("RANDOM TEXT ".generateRandomString(2000)); //Table $table = $section->addTable(); $table->addRow(); $table->addCell(848)->addText('No'); $table->addCell(2600, $cellStyleMerge)->addText("Title A"); $table->addCell(3400, $cellStyleMerge)->addText("Title B"); $table->addCell(3400, $cellStyleMerge)->addText("Title C"); $table->addCell(3400, $cellStyleMerge)->addText("Title D"); $table->addCell(1200, $cellStyleMerge)->addText("Title E"); for ($i = 0; $i <= 10; $i++) { if ($i % 2 == 0) { $table->addRow(); $table->addCell(848, $cellStyleMerge)->addText($i); $table->addCell(2600, $cellStyleMerge)->addText("text".$i); if ($i == 0) { $table->addCell(3400, $cellStyleMerge)->addText("text".$i); } else { $table->addCell(null, $cellStyleContinue); } $table->addCell(3400)->addText("text".$i); $table->addCell(3400)->addText("text".$i); $table->addCell(1200)->addText("text".$i); } else { //new task $table->addRow(); $table->addCell(null, $cellStyleContinue); $table->addCell(null, $cellStyleContinue); $table->addCell(null, $cellStyleContinue); $table->addCell(3400)->addText("text".$i); $table->addCell(3400)->addText("text".$i); $table->addCell(1200)->addText("text".$i); } } // SAVE $date = date_create(); $name = 'a6 - develop'; write($phpWord, $name, $writers); $download_link = "Download:
".$name."
"; return $download_link; } generate(); ?>

word2013-compatibility


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants