Forum


Replies: 5   Views: 3010
Template and additional table
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 testdocx  · 18-01-2017 - 15:44

Hi,

is it possible to load a Template and add a addtional table before creating the docx file?

Regards
Markus

Posted by admin  · 18-01-2017 - 15:48

Hello,

If you call load a template and then call addTable, the table is added after all existing contents.

You can add WordFragments in the template after or before any existing content:

http://www.phpdocx.com/api-documentation/docx-path/insert-elements-in-docx

Or replace a placeholder by a WordFragment:

http://www.phpdocx.com/api-documentation/templates/replace-variable-word-fragment-Word-document

This WordFragment can be a table, a list, a paragraph, an image... almost any Word content.

Regards.

Posted by testdocx  · 18-01-2017 - 16:13

Unfortunately, I'm not able to test it with the basic version :(

I try to achieve the following

On the first page of the document I use a template. On the second, I would like to create tables depending on the number of customers.

Is this possible with WordFragments?

Regards
 

Posted by admin  · 18-01-2017 - 16:57

Hello,

The easiest solution is using DOCXPath available in Advanced and Premium licenses.

Using the Basic package it can be done adding a placeholder in the template and replacing it by a WordFragment with a table a other placeholder than can be replaced too and so on.

Regards.

Posted by testdocx  · 19-01-2017 - 08:28

Hi,

sounds good. But there is no chance to test the Advanced Version first, right?

Regards
 

Posted by admin  · 19-01-2017 - 08:34

Hello,

No, the only trial available is of the Basic package. Of course we guarantee all methods will work as explained.

Regards.