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

Multiexcerpt
MultiExcerptNameintroduction

With the Excel Generator you can create Excel documents out of complex structured data.

Info
iconfalse

The Excel Generator uses the HSSF and XSSF component of Apache POI.

Multiexcerpt include
MultiExcerptNameExcelGenerator
nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

Data Model of the Excel Generator

This adapter uses a template file (Excel 97-2003 or Excel 2007 format) to create an Excel document. The data are specified by a map. The key values are used to reference their corresponding Data structure.

Image Modified

Procedure for Using the Excel Generator

  1. The adapter uses jXLS for configuring and building the resulting Excel documents. Create an Excel template file containing your jXLS.

    Image Modified

     To get a deeper understanding of the syntax used in the XLS templates, refer to the jXLS documentation.
  2. Create the needed objects in an action script in your UML model and provide the data.

    Image Modified

  3. Call the Excel generator.

Building an Excel Document

Figure: Relationships between the Action Script and the jXLS

Image Modified

generateExcel( filename : String, data : StringData[], templateFilename : String )

ParameterDirectionDescription
filenameinThe filename of the Excel output file.
datainThe map holding the data to be written to the Excel file.
templateFilenameinThe filename of the Excel template file.

The creation of an Excel document then is as simple as shown in the activity diagram below. Action create data contains the action script.

Image Modified

You can extract the javadoc folder from excelgenerator.jar to get additional information on the Java methods wrapped by this adapter.

Panel
titleOn this Page:
Table of Contents