Categories > OpenTBS with XLSX >

OpenTBS vs Office Excel xlsx

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: evzens
Date: 2013-07-09
Time: 10:48

OpenTBS vs Office Excel xlsx

When I created a simple template in  xlsx (MS Office 2007- Czech Version) resulting document is not merged.For the tests I used only the first sheet. After many tests have failed result. Finally, I used the original template in the demo example demo_ms_excel.xlsx. Everything was OK. But I opened the original template again and again saved in the same Name. Now came again a known bug. The document on the first sheet is not merged. It surprised me was that it merged the second and third sheet.

The reason I could not find it. Finally, I used between lines ... LoadTemplate .... and ... MergeBlock ...
$ TBS-> PlugIn (OPENTBS_SELECT_SHEET, 'Sheet1');
with the name of the first sheet.

Now the merger be a success!!
By: Skrol29
Date: 2013-07-12
Time: 23:40

Re: OpenTBS vs Office Excel xlsx

Thanks this explanation.
What should be changed according to yu ? The way OpenTBS merges sheets, or the explanation in the manual ?
By: evzens
Date: 2013-07-14
Time: 12:44

Re: OpenTBS vs Office Excel xlsx

I do not know, but it is important that everything worked well. I do not know why in the national versions of MSOffice does not normally merge the first sheet. Everything worked in version 1.6.1. I did upgrade to version 1.8 Merging the first sheet stopped working. I must add code on the first sheet, as described above After line LoadTemplate.
$ TPS-> PlugIn (OPENTBS_SELECT_SHEET, 'List1');

This is the correct code that must be used. (The first post is a mistake, Sheet1 should be properly List1)
This is The Czech version is normally the name of the List1 but not Sheet1. But I do not know why the merger of the second and the other sheet is OK.
By: Mark
Date: 2014-01-27
Time: 09:15

Re: OpenTBS vs Office Excel xlsx

I had a similar issue a few days ago in that nothing would merge except the example xlsx spreadsheet and even then only if I didn't save the example spreadsheet myself. After looking through all of the tbs_class and tbs_plugin_opentbs code for a few hours I found that my issue related to the below function call:


    function OpenXML_MapGetMain($ShortType, $Default) {
    // Return all values for a given type (or array of types) in the map.
   
        if (isset($this->OpenXmlMap[$ShortType])) {
            return $this->OpenXmlMap[$ShortType][0];
        } else {
            return $Default;
        }
    }

My thought is that the issue is that the script assumes the first worksheet mentioned in the XML is the current sheet and my Excel seems to save the worksheets backwards. When I checked the XML documents I could see that they were all over the place:

<Types>
<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="xml" ContentType="application/xml"/>
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
<Override PartName="/xl/worksheets/sheet2.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
<Override PartName="/xl/worksheets/sheet3.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
<Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
</Types>

So I assume the expected behaviour would be for it to default to sheet1 instead.