Data Plug-in

Create a MS Excel® Workbook without MS Excel®.

home Introduction
The Data Plugin enables you to read, write and manipulate MS Excel® workbooks and sheets from within your Servoy solution without the need to have MS Excel® installed.

Exporting data can be done using a 2D array (vArray[][]), a dataset or a foundset

The header can be retrieved from the input dataset or set separately via an array so you can create logical headers to the user or use i18n headers.

Importing data returns a 2D array or a (again) a regular dataset.

When using the readWorkBook and writeWorkBook methods it is possible to read and write a single cell, without touching/removing the available formatting and functions.
Since version 3.3 it is also possible to create a new Excel sheet with formatting properties.

To enable adding formatting options and functions we created a formatted dataset based on a 'normal' dataset.

With a the called 'FormattedDataset' you can:
  • set cell formatting
  • set column formatting
  • set borders
  • add formula's
  • etc.
The Data Plugin can output the following formats :
  •   XLS, XLSX, XLSM MS Excel®
  •   PDF Portable Document Format
  •   CSV Tab or comma delimited
  •   ODF Open Document Format
  •   HTML HyperText Markup Language
Next to outputting MS Excel® there are classes/methods to direct output :
  •   CSV Tab or comma delimited files
  •   DBF DataBase File files
  •   XML EXtensible Markup Language files
  •   TXT Text files
lightbulb_outline Benefits
  • To read, write and update MS Excel® files.
  • To script the import of data.
  • To script the export of data.
  • To automatically type cast (convert the import & export) data.
In fact whenever working with MS Excel® is necessary the Data Plugin will be your Plugin of choice.
swap_vertical_circle Compatibility
Smart client Headless client Web client Mobile client NG client
8.0+ 1.6+ check check check remove check check check check
7.0+ 1.6+ check check check remove n/a check check check
6.1+ 1.6+ check check check n/a n/a check check check
code How to Use
We published our API Specifications for the Data Plug-in as a future and current reference.

After downloading the Data Plug-in using our Components Manager a sample solution {servoy_root}/solutions/it2be-examples/it2be-data.servoy is installed.
You can import the sample solution into Servoy Developer and you will have some (basic) code examples of how to use the Data Plug-in.
bookmark FAQ
  • I use the Data Plugin in a webclient but need a local copy of the output file.

    In the below example I make use of the Tools Plugin to save the file in a 'safe' location on the webserver.
    But you can of course use your own method for that.

    By using the Servoy File Plugin as shown in the code example you can save (download) the resulting byte[] to the browser default 'downloads' folder.
    This should do the trick!

    vOutputFile = vExcel.write(plugins.it2be_tools.server().userHome + "/report.xls", null, vDataSet);
    
    application.output(vOutputFile, LOGGINGLEVEL.INFO);
    
    vData = plugins.file.readFile(vOutputFile);
    
    vResult = plugins.file.writeFile("report.xls", vData);
    
    application.output(vResult, LOGGINGLEVEL.INFO);				
description Release Notes
shop Buy Now
Developer
License
€ 400,00
One developer
&
unlimited deployment
€ 200,00 p/y
maintenance fee
Site
License
€ 880,00
Team of developers
&
unlimited deployment
€ 440,00 p/y
maintenance fee
Upgrade
License
€ 540,00
You already have a Single Developer license
€ 440,00 p/y
maintenance fee
Source
License
discuss
When you want to have access to the source code
not applicable