Daya Bay Reactor Neutrino Experiment TWiki > ExcelImportExportPlugin Daya Bay webs:
Public | 中文 | Internal | Help

Log In or Register


Renders an attached Excel spreadsheet as TWiki table


This plugin renders an attached Excel 2003 spreadsheet as a TWiki table, and vice versa. It also provides scripts to generate a set of topics from an Excel spreadsheet, and vice versa. In detail, the plugin supports the following use cases:

The code of this plugin is based on the TWiki:Plugins.ExcelImportExportAddOn by TWiki:Main.ClausLanghans.

General comments

This plugin establishes a correspondence between a spreadsheet and a TWiki table, or a set of TWiki topics. The spreadsheet must have a header row which defines the schema of the database represented by the spreadsheet.

The columns of the spreadsheet and the columns of the TWiki table are correlated via a TWiki form and/or a more detailed mapping table, see #ColumnMapping.

Syntax Rules

Please see the example in IssueExcelExportImport for more detail.

Mapping between Excel Spreadsheet and TWiki Table

In its simplest form, the correspondence between the Excel spreadsheet and the TWiki table is established through a TWikiForms template. This form corresponds to the header row in the spreadsheet: each field in the form is the same as a column field in the header row. All fields except date fields are assumed to be of type text.

Note that the order of the fields need not be the same, nor do all the column fields have to be present. Missing fields will be omitted in the import or export operations.

More details of the generated Excel spreadsheet can be defined in a mapping table, which is a table with the following layout:

Field Meaning Default
Name Name of the form field  
Short Name Excel column header. The Short Name and Name need to be the same if you want to be able to import the exported files without changing the column headers  
Width Width of the Excel column  
Orientation Vertical orientation of the Excel column, either h (horizontal) or v (vertical) h
Data Type empty, text, or date text

The mapping table, if present, overrides the form definition. If neither form nor mapping table are given, the column headings are inferred from the header line in table or spreadsheet. (A header line must be present, if a form or mapping table is not given.)

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %SMARTEDITPLUGIN_SHORTDESCRIPTION%

Note: Additional settings are available, but not yet documented.

Note: The parameters for the tags and scripts can also be defined in settings.

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this add-on. The following instructions are for the administrator who installs the add-on on the server where TWiki is running.

Look at the example in Sandbox...

Plugin Info

Plugin Author: TWiki:Main.ThomasWeigert, based on code by TWiki:Main.ClausLanghans
Copyright: © 2001-2014 TWikiContributor
© 2006 Motorola TWiki:Main.ThomasWeigert
© 2006 TWiki:Main.ClausLanghans
License: GPL (GNU General Public License External link mark)
Plugin Version: 2014-02-12
Change History:  
2014-02-12: TWikibug:Item7371: Typo fix -- thanks TWiki:Main.AnthonyRizzo
2012-10-17: TWikibug:Item6993: Disable uploading when current site mode is read-only or slave.
2012-10-17: TWikibug:Item6994: Bin scripts are out of date
2012-10-17: TWikibug:Item6995: Add "sheetnum" parameter for %EXCEL2TABLE{...}%
2012-10-17: TWikibug:Item6996: Add "dynamic", "html2text" and "scale" parameters to %TABLE2EXCEL%
2012-10-17: TWikibug:Item6997: Exported excel file doesn't support utf-8 charset.
July 2008: 4.2.x compatibility, Update Topic data from changed Form definition. - TWiki:Main.SvenDowideit
04 Nov 2006: Added abilty to upload spreadsheet. Rewritten for consistency and made more resilient. Enhanced documentation.
13 Aug 2006: Initial version
Spreadsheet::ParseExcel>=0Required. Available from CPAN External link mark.
Spreadsheet::WriteExcel>=0Required. Available from CPAN External link mark.
Date::Manip>=0Required. Available from CPAN External link mark.
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, ExcelImportExportPlugin nn%
Plugin Home:

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences, TWiki:Plugins.ExcelImportExportAddOn

Revision: r0 - 2014-02-13 - 03:01:08 - TWikiContributor

Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Daya Bay? Send feedback
Note: Please contribute updates to this topic on at TWiki:TWiki.ExcelImportExportPlugin.