TinyButStrong - the PHP Template Engine
Categories > OpenTBS with XLSX >

only one row displayed instead of 42 rows

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: chris
Date: 2017-02-13
Time: 12:02

only one row displayed instead of 42 rows

I get some data from a db into an array, this is working, I can show the records with print_r($this->data).
PHP-side:
$TBS = new clsTinyButStrong;
$TBS->PlugIn(TBS_INSTALL,TBS_EXCEL); // Install the Excel plug-in
$TBS->LoadTemplate('class/output/xls_template.xml',OPENTBS_ALREADY_UTF8);
$TBS->MergeBlock('rec',$this->data);
$TBS->Show(TBS_EXCEL_DOWNLOAD, "outfile.xls");

in Excel the data is referenced via [rec.p_id;block:table:table-row]    [rec.sage_id][rec.sagebank_id][rec.name]    [rec.vorname]    [rec.strasse]    [rec.nr]
each of them in a cell

I get one perfect row, but
why do I get only one row in excel instead of all rows?

Thanks for your help!
Chris
By: chris
Date: 2017-02-13
Time: 13:17

Re: only one row displayed instead of 42 rows

Sorry, I found a mistake:
[rec.p_id;block:table:table-row] is wrong, it should be [rec.p_id;block=table:table-row].

But now I get another error:
TinyButStrong Error in block's definition [rec.p_id...]: at least one tag corresponding to table:table-row is not found. Check opening tags, closing tags and embedding levels.
There are no brackets etc missing. I checked the field-names three times, the tag-names match the keys in the data-array. What does this message mean?

It works with an ods template! Since xlsx should also work with opentbs I tried it with opentbs: the same problem as with xls!
The Problem is, I need an xls or even better xlsx ;-)

Sorry and thanks,
Chris
By: Skrol29
Date: 2017-02-17
Time: 08:49

Re: only one row displayed instead of 42 rows

You should replace
   [rec.p_id;block:table:table-row]
with
   [rec.p_id;block=Row]
because in Excel-XML file format the row entity is <Row>.

I suggest that you use the OpenTBS plug-in instead of the TBS_EXCEL plug-in, that will enables you to have true XLSX template.