Skrol29 / opentbs

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.
http://www.tinybutstrong.com/opentbs.php
70 stars 17 forks source link

Removing data source from .docx after merge... #5

Open AzzaAzza69 opened 6 years ago

AzzaAzza69 commented 6 years ago

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);
Skrol29 commented 6 years ago

Can you give more details of what you're trying to do ?