Class ExcelStore

All Implemented Interfaces:
EditableTableModel, PopupActivationListener, Serializable, Comparable, EventListener, ListSelectionListener, TableModel

public class ExcelStore extends RamAttributeStore
This class reads a sheet from an Excel workbook. The column names are expected to be in a single row, and the skipRow parameter can can be used to skip over decorative heading rows. All rows are read and values are captured for the named columns. Rows that do not contain data (all blanks) are skipped. Additional data that are in columns beyond the named columns in the first row are ignored.

Data are copied from the worksheet and are held in memory. Blank lines in the worksheet are ignored. Aftet the table is loaded the original Excel workbook is closed.

Data are loaded using the format of the original Excel worksheet. By default data values will be treated as string values. If a column contains all integer or all numeric values with no blanks then the data will be automatically converted to integers or doubles and the default presentation format for integers and doubles will be used in the TableViewer. However, even a single blank cell in a column will prevent the conversion from string to numeric.

The makeExcelStore(java.lang.String,java.lang.String,int) method is used to load data in to the table. The startRow parameter may be used to skip over initial rows that appear prior to the column headings row.

This class is restricted to tables having a single time period.

See Also:
Serialized Form
  • Method Details

    • makeExcelStore

      public static RamAttributeStore makeExcelStore(String workbook, String worksheet, int skipRows)
      Construct the in-memory data store from an Excel worksheet.
      Parameters:
      workbook - the relative path to the Excel workbook
      worksheet - the name of the worksheet to use
      skipRows - the number of rows to skip before the header row