As part of our contract with the Bioneers, we've developed a reporting solution for Drupal based upon the well known JasperReports Java libraries.
How it works
Since JasperReports and Drupal "speak different languages" -- Drupal is in PHP, and the Jasper libraries are in Java, any solution needs some technique to pass the data over to a Java reporting app. We've developed a library that does this using Drupal's XMLRPC interface, the JasperReports plug-in and our custom version of iReports.
Here in brief is how it works:
- I use Drupal XMLRPC support, but add a token-based authentication scheme: you authenticate as a specific Drupal user, but your XMLRPC client does not need to be able to do either cookie or HTTP basic authentication. The code borrows from session.inc, and works about the same.
- A CiviCRM group or a Drupal View defines a query. There is also very limited support for doing a SQL query to Drupal tables.
- I originally planned some support for Flexinode, but since it turns out the Bioneers will be using CCK, we've commented out the code. If you're really interested in seeing Flexinode support, we'd need support to fund the work.
- Rich Toren (my brother, and a Java developer) has developed a JasperReports plugin that uses the XMLRPC interface to process the report. By using JasperReports and its iReports report designer, we let Jasper do the hard stuff, and just deliver records to the reporting engine.
- Rich also has developed a simple Java servlet that hosts our XMLRPC library. Our Query Exporter module puts up all the UI you need to communicate with the applet. Just define a query, and you can get PDFs, HTML and XLS output via a Drupal page. It's now working, but we need more people to pound on this.
Currently, the PHP files for the project have been released on the Drupal.org website. You can get the current Windows installer of our bundled version of iReport 1.2.5 here.
We've also looked into an "easy to install" Macintosh OS X version of iReport that bundles our code. If you know something about Java development on the Mac and can help, please contact us; we'd love to have full support for the Mac if at all possible.
We're releasing our Java source code on JasperForge in the next week or so. More info when the files are actually up.