Categories > OpenTBS with XLSX >

Dynamic Worksheet Name using Excel Plugin

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Deb ORourke
Date: 2007-08-18
Time: 05:10

Dynamic Worksheet Name using Excel Plugin

I am using the Excel plugin to merge data into a spreadsheet.  I would like each record to be displayed on it's own worksheet.  When using the block=Worksheet parameter, I get an XML error "to many tags" which I found out with a goole search means you are attempting to create worksheets with the same names.  The XML for the worksheet tag is like this:
<Worksheet ss:Name="Summary">
I would like the name to be the result of a data merge, like
<Worksheet ss:Name=[data.RECORD_NAME]>
but I can't get the syntax correct. 

Any assistance would be greatly appreciated.
By: Skrol29
Date: 2007-08-24
Time: 17:40

Re: Dynamic Worksheet Name using Excel Plugin

Hi Deb,

The main job the Excel plugin is precisely to manage some merging placed inside XML attributes. Unfortunately, it doesn't manage this one.

The solution I can give to you is a king of trick :
- On your Excel template, name your Sheet with a simple string which is unique, like "MySheetToMerge".
- In your application do something like this:

include('tbs_plugin_excel.php');
$TBS->PlugIn(TBS_INSTALL,TBS_EXCEL);
$TBS->LoadTemplate('my_template.xml');
...
// now replace the name with a TBS tag:
$TBS->Source = str_replace('MySheetToMerge','[data.RECORD_NAME]',$TBS->Source);
...
// Then merge your block
$TBS->MergeBlock('data',...);
$TBS->Show()
By: Daniel Degasperi
Date: 2013-10-24
Time: 16:55

Re: Dynamic Worksheet Name using Excel Plugin

Hi,
I've tried this workaround, but it seems not working anymore.

Do I something wrong or is there any other solution to make this work?

I've using OpenTBS 1.8.1

Best regards,
Daniel