Forum


Replies: 8   Views: 3771
Zero in wordfragment
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by neiron  · 27-02-2016 - 17:47

In topic: http://www.phpdocx.com/en/forum/default/post/4053

if text = 0, then table half-empty. Example:

$textFragment = new WordFragment($options['docx']);
  $text = array();
  $text[] =
    array(
      'text' => 'centered text',
      'underline' => 'single'
    );
  $paragraphOptions = array(
    'textAlign' => 'center',
  );
  $textFragment->addText($text, $paragraphOptions);

  $valuesTable = array(
    array(
      $textFragment,
    ),
    array(
      'Other text',
    ),
    array(
      'Other text',
    ),
  );

if replace 'text' => 'centered text' on 'text' => '0', then table clear cell value

 

Posted by admin  · 29-02-2016 - 07:57

Hello,

What version and license of phpdocx are you using? It's due to an empty check of the 'text' value.

Regards.

Posted by neiron  · 01-03-2016 - 07:48

PHPocX 4.6.3

Posted by admin  · 01-03-2016 - 08:24

Hello,

Your user doesn't have a license tied. Please post what license are you using: Trial, Pro, Corporate or Enterprise, and if you're using Corporate or Enterprise also post if you're using classic or namespaces package.

Regards.

Posted by General research Computer Center  · 02-03-2016 - 14:58

Good day, admin!
User NEIRON my colleague, therefore, if he, too, add license key, which is indicated from me. And actually the question that have NEIRON remains open

Posted by admin  · 02-03-2016 - 15:18

Hello,

The solution is very easy but we needed to know your license to suggest the line to be changed.

As you're using a PRO license, please edit the classes/CreateText.inc file and replace this (around line 444):

if (empty($texts['text'])) {
  $texts['text'] = '';
}

by:

if (!isset($texts['text'])) {
  $texts['text'] = '';
}

This change solves your issue.

Regards.

Posted by General research Computer Center  · 02-03-2016 - 15:18

By the way, if we can use the version 5.5?

Posted by admin  · 02-03-2016 - 15:29

Hello,

Using phpdocx 5.5 you need to do the same change but around line 451.

Regards.

Posted by neiron  · 03-03-2016 - 12:56

Yes, SUPER! All helped perfect!