Project

Structure

Connla allows a programmer to construct a table-like two dimensional data structure of class Connla, with arrays or Vectors, which contain the data that needs to be presented. Here each data element is referred to as an instantiation of class Connlon. Such an object can hold a String and additional layout settings like font style as bold or text colour. After the data has been organised in an object of class Connla, by filling it with objects of class Connlon, one can export to several different output formats like TXT, CSV, HTML, PDF, XLS, etc.

Connla provides a simple and generic way of exporting to different output formats without the programmer has to be aware or use all the different specific APIs for these formats. It will save time and will make the code more generic and extendable when other output formats are required.

Example

Below is an example of the use of Connla.

Fill Connla with Connlon elements

First an instance of Connla is created and filled with elements of class Connlon. Note that headers and normal elements are created in a very similar way.

In order to distribute the columns in a sane way, an arrays with relative widths is being passed to the Connla constructor. Note that an instance of Connla can also be created from Vectors of Connlon as opposed to arrays of Connlon.

Exporting Connla to various formats

Below can be seen that once Connla has been filled with proper data it is very easy to export to the different output formats.

Servlet example

On the file download page an war file can be downloaded with an example of how Connla can be used in a Java Application server like Tomcat to generate PDF in a new window from a HTML page. In this way one can implement a printer friendly button on a web page.