This project is read-only.

Using template with Recordset and CKEditor

Nov 12, 2012 at 2:01 PM

I am utilizing a template to store the data in.  Everything is working as expected for all 80 of the fields I am pulling from a recordset, my only issue is when I try to put in one of the other fields that contains html stored in the database.  The field I am trying to get in is stored in $row_rsTest['actualdebtcomments']


I am guessing I need to run it through the $html_dom but I am really not sure how to do this.


I have the recorset on the page (pulling data based on the url passed into the page.  


Then I have the following, trimmed down:

phprequire_once 'htmltodocx/phpword/PHPWord.php';
require_once 'htmltodocx/simplehtmldom/simple_html_dom.php';
require_once 'htmltodocx/htmltodocx_converter/h2d_htmlconverter.php';

$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('uw.docx');
$document->setValue('Value1', $row_rsTest['borrowerfirstname']);
$document->setValue('Value2', $row_rsTest['actualdebtcomments']);

As I stated, I have the template filling and saving with the correct values, except when I am trying to the Value2 in the above.  The word doc does not open saying there is an invalid character.  If I just have Value1, it works great or if I have non-html for Value2 it works great.


Just need an example of how to pull it from the specific recordset field.


Any help would be appreciated.