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

tbs:date and block=tbs:row

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

By: Alexey
Date: 2016-03-23
Time: 08:14

tbs:date and block=tbs:row

Hello.
I have a problem with mergin block=tbs:row in XLSX template in case when I have some fields with ope=tbs:date.
Example:

Date source is array, like:
$agences[] = array('id' => 1, 'date_creation' => '2016-01-01 10:00:00', 'date_fin' => '2016-02-15 12:10:05');

I create new XLSX book with one worksheet:
Cell A1 : [agences.id;block=tbs:row]
Cell B1 : [agences.date_creation;ope=tbs:date]
Cell C1 : [agences.date_fin;ope=tbs:date]

Mergin block:
$TBS->MergeBlock('agences',$agences);

After this, I have broken XLSX file.
If i remove ";block=tbs:row" from Cell A1, it work good and put correct numeric values in B1 and C1.

Where i'm wrong?
By: Alexey
Date: 2016-03-23
Time: 09:54

Re: tbs:date and block=tbs:row

Here is debug info done with
$TBS->Plugin(OPENTBS_DEBUG_XML_SHOW);

File merged with OpenTBS (XML reformated for debuging only): xl/sharedStrings.xml
------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3">
<si>
  <t>
   [agences.date_fin;ope=tbs:date]
  </t>
</si>
<si>
  <t>
   [agences.date_creation;ope=tbs:date]
  </t>
</si>
<si>
  <t>
   [agences.id;block=tbs:row]
  </t>
</si>
</sst>

File merged with OpenTBS (XML reformated for debuging only): xl/worksheets/sheet1.xml
------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
<dimension ref="A1:C1"/>
<sheetViews>
  <sheetView tabSelected="1" workbookViewId="0"/>
</sheetViews>
<sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>
<cols>
  <col min="1" max="1" width="11.85546875" bestFit="1" customWidth="1"/>
  <col min="2" max="2" width="35.5703125" bestFit="1" customWidth="1"/>
  <col min="3" max="3" width="30.5703125" bestFit="1" customWidth="1"/>
</cols>
<sheetData>
  <row r="1" spans="1:3" x14ac:dyDescent="0.25">
   <c r="A1" s="1" t="inlineStr">
    <is>
     <t>
      1
     </t>
    </is>
   </c>
   <c r="B1" s="1">
    <v>
     []
    </v>
   </c>
   <c r="C1" s="1">
    <v>
     42415.4653356
    </v>
   </c>
  </row>
</sheetData>
<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>
<pageSetup paperSize="9" orientation="portrait" verticalDpi="0" r:id="rId1"/>
</worksheet>
By: Alexey
Date: 2016-03-23
Time: 13:32

Re: tbs:date and block=tbs:row

I found that bug exist only when I use TinyButStrong version 3.10.0.
it's ok with TinyButStrong version 3.10.1.

So, solved.
By: Skrol29
Date: 2016-03-24
Time: 23:06

Re: tbs:date and block=tbs:row

ok