Loading...
 

Excel Plug-In

Image
The Excel Plug-In allows to open Excel® spreadsheet into the Data Manager window component. From there, the content of the Excel files is accessible in the Quick Visualizer and in OVL by standard API (see here).

We strictly recommend to only use the new API to access Excel files from inside OVL.

As a deprecated feature, you can also use independent Excel loader classes to handle Excel files in OVL.
Therefore, first of all, the package "omix.lang.io.excel" should be imported at the beginning of the code:

import omix.lang.io.excel.*;


Then inside of a method, you can use the Excel table classes:

var file = UserRequest.getFile("*.xls *.xlsx");
var horizontal = true; // does spreadsheet contain a horizontal header?
var sheetIndex = 0; // in case of multiple sheets specify index. 0 is always the first sheet.
var startRow = 0; // if data table contains comment rows skip.
var excelFile = new ExcelStringTable(file, horizontal, sheetIndex, startRow);

// accessing data is similar to CSV tables:
for(name in excelFile.colunns()){
    for(var i=0; i<excelFile.length();i++){
        var cellContent = excelFile.get(name, i);
        // processing cellContent...
    }
}


You can also use the types "ExcelDoubleTable" and "ExcelIntegerTable" in order to explicitely read real numbers and integer numbers out of the spreadsheet, respectively. In this case, "null" is returned if the corresponding cell does not contain content that can be interpreted as number.

You can also use a constructor with default values for sheetIndex (=0) and startRow (=0):

var excelFile = new ExcelStringTable(file, horizontal);


Excel® is a registered trademark of Microsoft Corporation.