Forum


Replies: 5   Views: 3266
Template table header example not working with changes
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 inca.sistemas  · 04-04-2011 - 15:09

Hello,

I have try the template_header.php example... and it runs OK, but if I put these in DOCX:

Weight (Kg) Price (€)
$NMONTE$ $RECINTO$ $SUP$
Total $TOTAL1$ $TOTAL2$

INSTEAD ........

Weight (Kg) Price (€)
$NAME$ $WEIGHT$ $PRICE$
Total $TOTALWEIGHT$ $TOTALPRICE$
--------------------------------

And this in PHP code:


$settings = array(
'header' => true
);



$docx->addTemplateVariable(
array(
array(
'NMONTE' => 'Product A',
'RECINTO' => '10',
'SUP' => '5',
),
array(
'NMONTE' => 'Product B',
'RECINTO' => '20',
'SUP' => '30',
),
array(
'NMONTE' => 'Product C',
'RECINTO' => '25',
'SUP' => '7',
),
),
'table',
$settings
);
$docx->addTemplateVariable('TOTAL1', '55');
$docx->addTemplateVariable('TOTAL2', '42');
$docx->addTemplateVariable('MYNAME', 'David Hume');

The result is:

Weight (Kg) Price (€)
Product A 10 5
Product B 20 30
Product C 25 7
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
$NMONTE$ $RECINTO$ $SUP$
Total 55 42
Total 55 42
Total 55 42
Total 55 42
Total 55 42
Total 55 42


What is happen ?¿?¿?¿?