Demonstrate the ExcelImportExportPlugin plugin
The two key features of the
ExcelImportExportPlugin plugin allow;
- Excel .xls files to be imported into a TWiki topic and displayed as a TWiki table
- A TWiki table to be exported to an Excel file
Example 1a
Create a TWiki table from an .xls file.
- Attach the .xls file (eg. demo.xls) to the topic (eg. Click the Attach button)
- Use the
%EXCEL2TABLE{}%
call to render the .xls file's data in a twiki table.
The call,
%EXCEL2TABLE{topic="%TOPIC%" file="demo"}%
produces the result,
Integers |
Floating |
Percentages |
Currency |
Dates |
Booleans |
Text |
-11 |
0.01 |
112.00% |
£5.00 |
Sun 1 Feb 76 |
FALSE |
Testing 1234 |
12 |
12.30 |
33.00% |
£10.00 |
Sun 12 Jul 07 |
TRUE |
Some text goes here |
-13 |
-123.00 |
44.00% |
£15.00 |
Mon 20 Dec 04 |
FALSE |
Hello World |
14 |
65.43 |
45.24% |
£25.00 |
Wed 20 Dec 06 |
FALSE |
qwertyuiop |
-15 |
10000.00 |
31.00% |
£123.00 |
Sun 14 Feb 09 |
TRUE |
data |
16 |
82.52 |
26.00% |
£65,536.00 |
Tue 5 Jul 63 |
TRUE |
strings |
data: demo.xls
As with all TWiki tables the sort order may be changed by clicking on the column headers.
Example 1b
Create a TWiki table from an .xls file using a TWiki template.
Note: previous versions of this plugin would not work without a template. The template feature appears to be redundant...
- Attach the .xls file (eg. demo.xls) to the topic (eg. Click the Attach button)
- Create a TWiki form with the same column headings as those of the .xls file. The form used by this example is PluginTestExcelImportExportForm.
- Use the
%EXCEL2TABLE{}%
call to render the .xls file's data in a twiki table.
The call,
%EXCEL2TABLE{topic="%TOPIC%" file="demo" template="PluginTestExcelImportExportForm"}%
produces the result,
Integers |
Floating |
Percentages |
Currency |
Dates |
Booleans |
Text |
-11 |
0.01 |
112.00% |
£5.00 |
Sun 1 Feb 76 |
FALSE |
Testing 1234 |
12 |
12.30 |
33.00% |
£10.00 |
Sun 12 Jul 07 |
TRUE |
Some text goes here |
-13 |
-123.00 |
44.00% |
£15.00 |
Mon 20 Dec 04 |
FALSE |
Hello World |
14 |
65.43 |
45.24% |
£25.00 |
Wed 20 Dec 06 |
FALSE |
qwertyuiop |
-15 |
10000.00 |
31.00% |
£123.00 |
Sun 14 Feb 09 |
TRUE |
data |
16 |
82.52 |
26.00% |
£65,536.00 |
Tue 5 Jul 63 |
TRUE |
strings |
data: demo.xls
As with all TWiki tables the sort order may be changed by clicking on the column headers.
Example 1c
Create a TWiki table from a more complex .xls file without a template.
- Attach the .xls file (eg. kernel_performance.xls) to the topic (eg. Click the Attach button)
- Use the
%EXCEL2TABLE{}%
call to render the .xls file's data in a twiki table.
The call,
%EXCEL2TABLE{topic="%TOPIC%" file="kernel_performance"}%
produces the passable result,
|
|
|
|
|
|
|
|
with USE_GNU |
|
|
|
|
|
|
|
|
No instrumentation |
|
With libsafe |
|
% Overhead |
|
|
|
No instrumentation |
|
With libsafe |
|
% Overhead |
getwd() |
|
3.71 |
|
3.46 |
|
-6.73854447439353 |
|
getwd() |
|
3.91 |
|
3.63 |
|
-7.1611253196931 |
strcpy(1) |
|
0.06 |
|
0.5 |
|
733.333333333333 |
|
strcpy(1) |
|
0.05 |
|
0.39 |
|
680 |
strcpy(256) |
|
1.37 |
|
3.1 |
|
126.277372262774 |
|
strcpy(256) |
|
1.36 |
|
1.78 |
|
30.8823529411765 |
strcpy(1024) |
|
5.21 |
|
10.22 |
|
96.1612284069098 |
|
strcpy(1024) |
|
5.2 |
|
5.23 |
|
0.576923076923082 |
strcat(1) |
|
0.07 |
|
0.48 |
|
585.714285714286 |
|
strcat(1) |
|
0.06 |
|
0.56 |
|
833.333333333333 |
strcat(256) |
|
2.01 |
|
3.08 |
|
53.2338308457712 |
|
strcat(256) |
|
2 |
|
1.91 |
|
-4.5 |
strcat(1024) |
|
7.76 |
|
10.2 |
|
31.4432989690722 |
|
strcat(1024) |
|
7.76 |
|
5.47 |
|
-29.5103092783505 |
sprintf(1) |
|
2.02 |
|
1.45 |
|
-28.2178217821782 |
|
sprintf(1) |
|
2.02 |
|
1.44 |
|
-28.7128712871287 |
sprintf(25) |
|
5.2 |
|
4.63 |
|
-10.9615384615385 |
|
sprintf(25) |
|
5.2 |
|
4.63 |
|
-10.9615384615385 |
sprintf(1024) |
|
13.96 |
|
13.4 |
|
-4.01146131805158 |
|
sprintf(1024) |
|
13.97 |
|
13.4 |
|
-4.08017179670723 |
realpath(49) |
|
4.35 |
|
4.63 |
|
6.43678160919541 |
|
realpath(49) |
|
4.36 |
|
4.49 |
|
2.98165137614679 |
dlsym(strcpy) |
|
1.26 |
|
1.16 |
|
-7.93650793650794 |
|
dlsym(strcpy) |
|
1.26 |
|
1.16 |
|
-7.93650793650794 |
|
|
No instrumentation |
|
With libsafe |
|
% Overhead |
|
|
|
|
|
|
|
|
getwd() |
|
4.07 |
|
3.95 |
|
-2.94840294840295 |
|
|
|
|
|
|
|
|
strcpy(1) |
|
0.05 |
|
0.39 |
|
680 |
|
|
|
|
|
|
|
|
strcpy(256) |
|
1.55 |
|
1.96 |
|
26.4516129032258 |
|
|
|
|
|
|
|
|
strcpy(1024) |
|
5.74 |
|
5.85 |
|
1.9163763066202 |
|
|
|
|
|
|
|
|
strcat(1) |
|
0.06 |
|
0.56 |
|
833.333333333333 |
|
|
|
|
|
|
|
|
strcat(256) |
|
2.13 |
|
2.11 |
|
-0.938967136150236 |
|
|
|
|
|
|
|
|
strcat(1024) |
|
8.5 |
|
5.93 |
|
-30.2352941176471 |
|
|
|
|
|
|
|
|
sprintf(1) |
|
2.28 |
|
1.42 |
|
-37.719298245614 |
|
|
|
|
|
|
|
|
sprintf(25) |
|
5.64 |
|
4.99 |
|
-11.5248226950355 |
|
|
|
|
|
|
|
|
sprintf(1024) |
|
15.36 |
|
14.85 |
|
-3.3203125 |
|
|
|
|
|
|
|
|
realpath(49) |
|
4.52 |
|
4.6 |
|
1.76991150442478 |
|
|
|
|
|
|
|
|
dlsym(strcpy) |
|
1.26 |
|
1.16 |
|
-7.93650793650794 |
|
|
|
|
|
|
|
|
data: kernel_performance.xls
Example 2
Create, edit and export a .xls file from a TWiki table.
The call,
%TABLE2EXCEL{topic="%TOPIC%" file="%WEB%_mytestexcelfile"}%
induces the browser to prompt to save the table as an Excel file with the specied name.
The file="" field is optional. Without it, the browser should invoke the application (eg. MS Excel) by default.
See
https://twiki.ph.rhul.ac.uk/twiki/bin/view/ShowCase/PluginTestExcelImportExport?raw=on for the TWiki markup which produces the editable table below.
Note: The
%TABLE2EXCEL{}%
call
MUST be placed at the top of the table and not below it!
See
ExcelImportExportPlugin for full plugin details.
--
TomCraneAdmin - 27 August 2012