Categories > [old] TbsOoo & TinyDoc >

Serial letters -> Save each instance?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: h3ll
Date: 2010-11-02
Time: 09:59

Serial letters -> Save each instance?

Hi there,

at first cheers at your great work.
I have a question regarding multipage documents: I have the requirement to build serial letters and save the whole document including all merged data and save a seperate file for each row in my dataset. (Currently my setup just saves the whole merge into one file)
Is this possible in some way?

Thanks in advance. regards
By: Skrol29
Date: 2010-11-02
Time: 11:05

Re: Serial letters -> Save each instance?

Hi,

You can change your template to be only for one page. And then, at the PHP side, instead of a MergeBlock() you can loop on the data rows and build one document for each row. Save each document with a separate name.

There maybe is a feature in OpenOffice to explode a document into several documents but I don't know it.
By: h3ll
Date: 2010-11-02
Time: 11:23

Re: Serial letters -> Save each instance?

hi and thx for your fast response

ok had thought of this solution also but would have preferred the comfort of MergeBlock() ;)

thx anyway and keep up the gr8 work

regards
By: h3ll
Date: 2010-11-17
Time: 15:12

Re: Serial letters -> Save each instance?

Hi there,

i tried to work on your solution to iterate the resultset and merge each row to one document. i fetch each row into an php array and try to invoke MergeBlock on it. but TBS is giving me errors that some fields defined in the template are not contained in the array keys, but they are!

is there any limitation in the size of the array parameter? (mine is about 120 columns in size). see my example below:

//filling the array
$data_row = oci_fetch_array($stmt,OCI_ASSOC+OCI_RETURN_NULLS)
...
//merging
$this->TBS->MergeBlock("d",$data_row);


the result is a bunch of those messages:
TinyButStrong Error in field [d.K_ANSCHRIFT...]: item 'K_ANSCHRIFT' is not an existing key in the array. This message can be cancelled using parameter 'noerr'.


>>edit:
if i call the MergeBlock method with the database connection and the query, i get the expected result (no error, everything merged fine)
  $this->TBS->MergeBlock("d",$this->conn,$sql1);

so i tried to replace my oci_fetch_array() method with the OciFetchInto() like its used in the TBS Oracle plugin, but no success...

appreciate any answer :s



By: Skrol29
Date: 2010-11-17
Time: 20:44

Re: Serial letters -> Save each instance?

Hi,

Such a $data_row array is not an array of array as expected by MergeBlock.

You have to code
$this->TBS->MergeBlock("d",array($data_row));
or
$this->TBS->MergeField("d",$data_row);
By: h3ll
Date: 2010-11-18
Time: 08:21

Re: Serial letters -> Save each instance?

oh silly me :(

but thx anyway :)