We have recently added a new feature to jasper_reports module that allows users to have access to fields structure from iReport, avoiding the need of creating the XML file. Note that although the module works with both v5 and v6 this feature will only be available in v6.
Using this functionality is really easy. Simply install latest version of jasper_reports module and in iReport create a new Remote XML file datasource. And in XML URL specify OpenERP’s XML-RPC URL and append “/jasper/” and the internal name of the model we want to use (in the example “purchase.order”). After that we can add several paramaters, but all of them are optional, because they can be specified in openerp’s server configuration file and they also have default values. Here’s a list of parameters available:
| URL Parameter | Server parameter | Default Value | Description |
|---|---|---|---|
| database | jasper_database | demo | Name of the database |
| user | jasper_user | admin | Username |
| password | jasper_password | admin | Password of the user |
| depth | jasper_depth | 3 | Depth of the tree of fields to use |
| language | jasper_language | en | Language to use for field labels. Use language & country, such as “ca_ES”. |
Example: ”http://192.168.0.1:8069/jasper/purchase.order?database=demo&user=admin&password=admin&depth=3&language=ca_ES”
Once you’ve created the datasource, you can go to the database section, select XPath as language and you’ll have all fields available, the same way you did when you created an XML file.
Note that there’s still a small bug in the module with no consecuences from a user’s perspective but that will show a traceback in server’s log. If someone wants to fix it, a patch will be very welcomed!


Enhorabona per aquesta nova funcionalitat! molt útil per no haver de crear cada cop el XML.
Hem hagut d’actualitzar iReport a la 4 pq el Xpath es pugin veure els camps (abandonar la 3.7).
També una manera de saber si la URL “es correcta” és afegir-ho al navegador web i veuràs tot el XML que genera.
Salut!
Thanks for your great work, but please turn off auto update date of your blogs, because on http://openobject.com/planet I can not see other blogs, your blogs is full fill here!
We have recently added a new feature to jasper_reports module that allows users to have access to fields structure from iReport, avoiding the need of creating the XML file. Note that although the module works with both v5 and v6 this feature will only be available in v6. Pharmacy
Hi ! Great news and great job, but i must havec missed something…
I tried for 2 hours to get rows with XPath and never managed.
Yet I managed to get the structure on the right of the report query, but each time I used “Refresh Preview Data”, no records were read.
Some facts :
It worked with SQL (btw, the SQL query editor is much more user friendly than the XPath query editor, where you have to type everything, no selection or drag and drop…)
I tried with iReport 4.1.1, 4.0.2, 4.0.1 and 3.7.6, I never got a record.
here my datasource connection : http://localhost:8069/jasper/res.partner?database=demo_OpenERP&user=admin&password=demo&depth=4 (I tried from 1 to 4, to no avail)
I tried with your example : purchase.order and with account.invoice. No results with XPath (all results with SQL).
Here is my ultra-complicated Xpath query : /data/record/id (I tried putting [1] to each in turn, to no avail)
Please, I’m getting mad…
Hi. Great news and great job. But I must have missed something…
My connection : http://localhost:8069/jasper/res.partner?database=demo_OpenERP&user=admin&password=demo&depth=4 (tried from 1 to 4, to no avail)
My XPath query : /data/record/id (tried put [1] to each in turn, to no avail)
I tried with account.invoice and your example purchase.order, no results.
Yet I manage to get the structure on the right of the query screen, but no records. By SQL I get what I want.
I restarted the server.
I tried with ireport 4.1.1, 4.0.2, 4.0.1, 3.7.6.
Please, a bit of help, I’m getting mad on this…
Esto significa que podemos modificar informes y no tener que montarlos desde el inicio?
Gracias
Hello Mr Cervera i Areny,
I tried this and i get a valid test connection but when i select xpath i don’t see any fields.
I reinstalled the latest jasper_reports module.
I am sorry but it seems very good if we could do this.
Can you help me out please?
Thanks in advance
Jean-Paul Robineau
Hello Mr Cervera i Areny,
I tried this but it doesn’t work.
I get a valid test connection.
But when i go and select xpath, i don’t get any fields.
Can you help me please?
Thank you very much
Jean-Paul Robineau