Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0

Otp
maxHLevel1

Multiexcerpt
MultiExcerptNameintroduction

With the Spreadsheet adapter you can access Excel documents via their workbook-sheet-row-cell structure and create CSV files out of Excel documents.

Info
iconfalse

The Spreadsheet adapter uses the HSSF and XSSF component of Apache POI.

Multiexcerpt include
MultiExcerptNameSpreadsheet
nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

Data Model of the Spreadsheet Adapter

The adapter provides a data model (Workbook, Sheet, Row, Cell) representing the Excel document. This data model is created by calling one of the various createWorkbook operations.

Figure: Data Model of the Spreadsheet Adapter

Image Modified

Creating a Workbook

Figure: Activity for Creating a Workbook

Image Modified

createWorkbook( filename : String ) : Workbook

returns a Workbook object (empty cells/rows are omitted)

ParameterDirectionDescription
filenameinThe filename of the Excel document.
workbookreturnThe Workbook object representing the Excel document.

createWorkbook( filename : String, omitEmptyCells : Boolean ) : Workbook 

returns a Workbook object

ParameterDirectionDescription
filenameinThe filename of the Excel document.
omitEmptyCellsinIf true, empty cells/row will be omitted from the returned Workbook object.
workbookreturnThe Workbook object representing the Excel document.

createWorkbook( input : Blob ) : Workbook

returns a Workbook object (empty cells/rows are omitted)

ParameterDirectionDescription
inputinThe blob holding the Excel document.
workbookreturnThe Workbook object representing the Excel document.

createWorkbook( input : Blob, omitEmptyCells : Boolean ) : Workbook 

returns a Workbook object

ParameterDirectionDescription
inputinThe blob holding the Excel document.
omitEmptyCellsinIf true, empty cells/row will be omitted from the returned Workbook object.
workbookreturnThe Workbook object representing the Excel document.

Generating CVS out of Excel Documents

The adapter provides various toCVS operations to generate CVS documents out of Excel documents.

Figure: Acticity for Generating a CVS Document

Image Modified

toCSV( filename : String, sheetNumber : Integer, separator : String, encoding : String ) : Blob

ParameterDirectionDescription
filenameinThe filename of the Excel document.
sheetNumberinThe number of the worksheet to be converted.
separatorinThe separator character to be used in the CSV document(s).
encodinginThe encoding (e.g. "utf-8") of the CSV data.
returnreturnA blob holding the CSV data.

There are variants of this operation where sheetNumber (default: 0), separator (default: ,) or encoding don't have to be set.

toCSV( workbook : Workbook, sheetNumber : Integer, separator : String, encoding : String ) : Blob

ParameterDirectionDescription
workbookinThe Excel workbook to be converted.
sheetNumberinThe number of the worksheet to be converted.
separatorinThe separator character to be used in the CSV document(s).
encodinginThe encoding (e.g. "utf-8") of the CSV data.
returnreturnA blob holding the CSV data.

There are variants of this operation where sheetNumber (default: 0), separator (default: ,) or encoding don't have to be set.

toCSV( sheet : Sheet, separator : String, encoding : String) : Blob

ParameterDirectionDescription
sheetinThe Excel worksheet to be converted.
separatorinThe separator character to be used in the CSV document(s).
encodinginThe encoding (e.g. "utf-8") of the CSV data.
returnreturnA blob holding the CSV data.

There are variants of this operation where separator (default: ,) or encoding does not have to be set.

Extract the javadoc folder from spreadsheetadapter.jar to get additional information on the Java methods wrapped by this adapter.

Panel
titleOn this Page:
Table of Contents