iReports - tips and tricks

NOTE that this is a first draft and may contain errors - if you see any, please comment.

The following may help when you start trying to edit or create reports for OpenVPMS.

Version: although iReports is now up to version 5, for the current version of OpenVPMS (1.6) you need to use iReports 3.7.6.

Manual: you may find that http://jasperreports.sourceforge.net/JasperReports-Ultimate-Guide-3.pdf is useful.

Concepts: OpenVPMS uses two types of 'reports' - those that you run as Reports and which use SQL to extract data from the database, and those that are invoked by various document Print requests - and for these the OpenVPMS code provides the data to the report. For the SQL ones you can use the Preview function with iReports to test your report.  For the others, you cannot (unless you are clever and dummy up the required data) so testing is a matter of uploading your new/modified report into the appropriate OpenVPMS report template, and then printing an invoice (or whatever).

Data Source: in order to use the preview function, you have to tell iReports what the data source is.  When you start iReports, the initial display (after you dismiss the 'new version available' message box) looks like the following:

As it says, step 1 is to create the database connection.  You need to create a "Database JDBC Connection". You can see in the top left, I have previously created what I called "OpenVPMS - Local". Clicking the 'Report Datasources'  button to the left of this shows the available data sources.  Below is what I have with the 'OpenVPMS - Local' one (my default) expanded.

If you don't set up the datasource, then by default you will be using iReports 'empty datasource' and your report preview will show nothing.

---to be continued---

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I've been successful using 5.0, but the compatability mode option needs to be enabled. Cheers, Paul
Syndicate content