BIRT overly complex??
I have been tasked with evaluating some aspects of OSS reporting frameworks. I have also looked at and sat through demos of Crystal and Cognos. I have used some charting frameworks in other languages, but the Java report frameworks and BI are new to me.<br />
<br />
I have looked at JFreechart and a little at Jasper. I am trying to grok BIRT, but while the report designer seems to be heads above the other OSS designers, the underlying framework seems overly complex and intimidating. Just as an example, compare this (from the BIRT FAQ) example of how to write a chart to a an image:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
// define a chart structure
Chart cm = SampleCharts.createMyChart();
// obtain a png image device renderer
PluginSettings ps = PluginSettings.instance();
IDeviceRenderer idr = null;
try {
idr = ps.getDevice("dv.PNG");
} catch (ChartException pex) {
DefaultLoggerImpl.instance().log(pex);
}
// define the bounds in points
Bounds bo = BoundsImpl.create(0, 0, 800, 600); // in points
// build the rendered chart structure
Generator gr = Generator.instance();
GeneratedChartState gcs = null;
try {
gcs = gr.build(
idr.getDisplayServer(),
cm, null,
bo, null
);
} catch (ChartException gex) {
DefaultLoggerImpl.instance().log(gex);
System.exit(0);
}
// render the chart to a png file
Image img = new BufferedImage(
(int) bo.getWidth(), (int) bo.getHeight(), BufferedImage.TYPE_INT_ARGB
);
idr.setProperty(IDeviceRenderer.FILE_IDENTIFIER, "chart.png");
try {
gr.render(idr, gcs);
} catch (ChartException rex) {
DefaultLoggerImpl.instance().log(rex);
}
</pre>
And this example I wrote using JFreeChart to do something similar:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
public class SimplePieChart
{
public SimplePieChart()
{
final DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("One", new Double(43.2));
dataset.setValue("Two", new Double(10.0));
dataset.setValue("Three", new Double(27.5));
dataset.setValue("Four", new Double(17.5));
dataset.setValue("Five", new Double(11.0));
dataset.setValue("Six", new Double(19.4));
try
{
ChartUtilities.saveChartAsPNG(new File("test"),
ChartFactory.createPieChart("Pie Chart", dataset, false, true, false),
500, 500);
}
catch (IOException ex)
{
System.out.print(ex.getLocalizedMessage());
}
}
}</pre>
<br />
I really want to like BIRT as the designer seems nice (and that is a factor in our situation), but every time I scratch the surface and look at what is underneath I can't help but feel that I would thrash about getting lost in low level or complex implementation details.<br />
<br />
Is it just me? Am I simple minded? Does it have to be this arcane?