Latest revision as of 12:42, 25 July 2012

Contents

Java - Build a Dynamic Table

This example opens an existing report and adds a data source, data set and a table.
The table columns are dynamically created based on an ArrayList that is passed in. The columns must
exist in the query that is passed in.

Edit the first line to point to the actual location where you installed the BIRT runtime.
The second line must point to an existing report.
The last line is the location where the report will be written to. The directory must exist prior to saving the report.

Compiling the Example

When running this example from within Eclipse, the Java Build Path for the project must contain all of the libraries in the BIRT_HOME/lib directory as well as the JRE System Library.

Comments

Hello,

thank you for this great example.

I would like to utilize it with other oda-drivers.

At the moment i have problems, because I got a java.lang.NullPointerException.
In that part it occured:
OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource(
"Data Source", "org.eclipse.birt.report.data.oda.jdbc" );
dsHandle.setProperty( "odaDriverClass",
"org.eclipse.birt.report.data.oda.sampledb.Driver" );