Hi Guys,
I'm trying to create a block of elements that looks something like below.
Heading
Text Description
Table
Row1
Row2
Row3 etc
The problem I am facing is because the table has a dynamic amount of rows it will somtimes run onto other pages and I'd like it to stay with the heading and description by not running on to other pages.
I am correct in assuming the best way to do this is to build up a word fragment containing these elements (heading, text and table) then use addText with keepLines to keep it all on the same page in one paragraph?
I tried this and I seem to get blank output. Below is how I'm using it.
$wf = new WordFragment($docx, 'document');
$wf->addText($BenefitData['TitleOfTable'], array('font' => 'Calibri Light', 'fontSize' => 16, 'color' => '2E74B5', 'bold' => false));
$wf->addText($BenefitData['TitleDescription']);
$wf->addTable($valuesTable, $paramsTable, array('cantSplitRows'=>true));
$wf_new = new WordFragment($docx, 'document');
$wf_new->addText($wf, array('keepLines' => true));
$docx->replaceVariableByWordFragment(array('BenefitTables' => $wf_new), array('type' => 'block'));
Can you see anything wrong with the above or can you think of a different/better way of doing what I'm trying to achieve?