Forum


Replies: 3   Views: 3902
Several table variables inside docx template: only first table will be filled.
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 vchaikevitch  · 25-10-2015 - 23:45

Hallo,

the version I currently use is 3.7. If I use a table variables in a DOCX template file like

==========================================
Name              | Test1        |     Test2        |     Test3        |
==========================================
$V1_Name$    | $V1_1$    |     $V1_1$    |     $V1_2$    |
==========================================

It works fine. But adding the same table twice to the template file like

==========================================
Name              | Test1        |     Test2        |     Test3        |
==========================================
$V1_Name$    | $V1_1$    |     $V1_1$    |     $V1_2$    |
==========================================

asdjlfkjasdlkfjasdjflkasdjflk

==========================================
Name              | Test1        |     Test2        |     Test3        |
==========================================
$V1_Name$    | $V1_1$    |     $V1_1$    |     $V1_2$    |
==========================================

causes problems. In the result DOCX document the first table is filled nearly correct: all data will be added correct but an additional row will be added containing only the first column with not replaced variable $V1_Name$. For the second table no row will be filled correct: the first column in each row contains $V1_Name$, other colums are empty.

Thanks a lot for hins and possible solutions.

Best regards,

Vitali