With OpenTBS you can merge OpenOffice - LibreOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use OpenOffice - LibreOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats. That is the Natural Template philosophy.
Usually, after performing a mailmerge, the document is 'flattened' and all merge fields / source data is removed. I can't see any option to do this and when I load the target document, it displays "Opening this document will run the following SQL command...". Here is my code to do the mail merge:
$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->PlugIn(OPENTBS_SELECT_HEADER); // process merge fields in header
$TBS->PlugIn(OPENTBS_SELECT_FOOTER); // process merge fields in footer
$TBS->MergeBlock('',$this->aMergeData);
$TBS->LoadTemplate($this->sSourceFilename, OPENTBS_ALREADY_UTF8);
$TBS->Show(OPENTBS_FILE, $this->sTargetFilename);
Usually, after performing a mailmerge, the document is 'flattened' and all merge fields / source data is removed. I can't see any option to do this and when I load the target document, it displays "Opening this document will run the following SQL command...". Here is my code to do the mail merge: