
This DevShare submission qualifies for the
Plug In 2 BIRT Contest!<br />
<br />
It seems most systems these days have to provide some kind of dynamic-schema so that users can define their own fields for stored objects.<br />
<br />
The typical way to do this involves three tables:
<br />
- A metadata table that describes the fields available.<br />
- A primary table that contains one row per object (primary key typically object ID).<br />
- A field value table that contains one per field set on each object (primary key typically object ID, field ID).<br />
<br />
Unfortunately BIRT doesn't provide an easy way to report on these kinds of structures. Users often end up trying to make do with crosstabs, but they are the wrong tool for the job (formatting is much more complex; including additional fixed columns is awkward; they are slower and memory intesive). The other approach is to dynamically flatten the data in SQL - frequently by dynamically modifying the SQL, which has it's own disadvantages (possibly open to injection; can be very inefficient for some database engines/models; requires a lot of boiler plate script).<br />
<br />
Faced with this problem (and a lot of nagging from my users to do
something to make their life easier) I produced this plugin.<br />
<br />
The plugin contains:
<br />
- PrepareDynamicColumns - Script function<br />
Create a scripted datasource based on two ODA datasources (intended to work directly with the flexible fields data model described above).<br />
- RebindTable - Script function<br />
Bind a table to a dynamic column dataset instead of the primary dataset (can work either with the output from PrepareDynamicColumns or with a DataSet that has been modified on the fly).<br />
- DynamicColumnsEventHandler - Scripted DataSet EventHandler<br />
Used by PrepareDynamicColumns to present the two merged DataSets.<br />
<br />
Documentation is all on the BitBucket wiki.<br />
Enjoy.
https://bitbucket.org/yaytay/spudsoft-birt-dynamic-columns