Can not clone row, template variable not found or variable contains markup
Hi guys, I have this template [1] with two tables, I have no problem with the second table, I have code like this:
$plantilla->cloneRow('numeroCDP', 4);
--Values
$plantilla->setValue('numeroCDP#1', 1);
...
$plantilla->setValue('numeroCDP#4', 4);
For the first table I have the following code (dinamic created values):
$plantilla->cloneRow($campoClonar->getAlias(), $totalFilas);
for($f=1; $f<=$totalRows; $f++){
foreach($fields as $field){
$plantilla->setValue($field->getAlias().'#'.$f, utf8_encode(strip_tags('The value')));
}//End foreach ($fields)
}
And I have this error: Can not clone row, template variable not found or variable contains markup
Do you know what can be wrong with my code or my template??
Thanks in advance
[1] http://www.mediafire.com/view/c6wbpc77uk1obs9/PlantillaElvira.docx
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
One of the common source of problem with template is that the variable is separated into multiple run. Please try to "clear all styles" in the variable part of your template that causes the problem. I'll find time (probably tonight) to look at your template xml file.
Can you check the value of $campoClonar->getAlias()? It should be equal to tablaCantidad. I've been able to clone the row with the following code:
$document->cloneRow('tablaCantidad', 2);
$document->setValue('tablaCantidad#1', 'A');
$document->setValue('tablaCantidad#2', 'B');
I've had issues today where Word's spellchecker was causing the tags in the documents.xml to change the tag. The solution I've found for this was ignoring the spell checker by right clicking on the word and "ignore all".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.
I think cloneRow reported an error because the format of the table used in the template creation process was wrong, so that when copying ${data}, the process did not recognize that it was a table.