Odoo Help


OpenERP 7.0, jasper_report, iReport and SQL parameters

on 7/24/14, 11:02 AM 1,646 views


I am using the iReport integrated with jasper_report module in OpenERP 7.0. with XML without problems.

But, I created a report using iReport 5.5 with a JDBC SQL connection to my postgresql database with a sql query as the datasource. In iReport, I added a parameter named IDS to capture the data passed from OpenERP to the report. This parameter data type is set java.lang.Object..

I added another parameter named PIDS with a data type of java.util.List and a default expression of $P{IDS}.toList(). Finally, the report language is set to Groovy.

In the WHERE clause of the query, I used the $X syntax to retrieve records for all the passed ids:
where $X{IN, id, PIDS}

I have a following compile error:

Imágenes integradas 1

  The SQL QUERY ->


     iqcirugia."id" AS iqcirugia_id,

     iqcirugia."create_uid" AS iqcirugia_create_uid,

     iqcirugia."create_date" AS iqcirugia_create_date,

     iqcirugia."write_date" AS iqcirugia_write_date,

     iqcirugia."write_uid" AS iqcirugia_write_uid,

     iqcirugia."autoriza" AS iqcirugia_autoriza,

     iqcirugia."paciente" AS iqcirugia_paciente,

     iqcirugia."nhc" AS iqcirugia_nhc,

     iqcirugia."payment_term" AS iqcirugia_payment_term,

     iqcirugia."fec_oper" AS iqcirugia_fec_oper,

     iqcirugia."centro" AS iqcirugia_centro,

     iqcirugia."partner_invoice_id" AS iqcirugia_partner_invoice_id,

     iqcirugia."tarjeta" AS iqcirugia_tarjeta,

     iqcirugia."otros" AS iqcirugia_otros,

     iqcirugia."partner_id" AS iqcirugia_partner_id,

     iqcirugia."name" AS iqcirugia_name,

     iqcirugia."fiscal_position" AS iqcirugia_fiscal_position,

     iqcirugia."user_id" AS iqcirugia_user_id,

     iqcirugia."tipo_id" AS iqcirugia_tipo_id,

     iqcirugia."doctor" AS iqcirugia_doctor,

     iqcirugia."company_id" AS iqcirugia_company_id,

     iqcirugia."state" AS iqcirugia_state,

     iqcirugia."payment_type" AS iqcirugia_payment_type,

     iqcirugia."pricelist_id" AS iqcirugia_pricelist_id,

     iqcirugia."poliza" AS iqcirugia_poliza,

     iqcirugia_location."id" AS iqcirugia_location_id,

     iqcirugia_location."create_uid" AS iqcirugia_location_create_uid,

     iqcirugia_location."create_date" AS iqcirugia_location_create_date,

     iqcirugia_location."write_date" AS iqcirugia_location_write_date,

     iqcirugia_location."write_uid" AS iqcirugia_location_write_uid,

     iqcirugia_location."cirugia_id" AS iqcirugia_location_cirugia_id,

     iqcirugia_location."location_id" AS iqcirugia_location_location_id,

     iqcirugia_location."name" AS iqcirugia_location_name,

     stock_location."id" AS stock_location_id,

     stock_location."parent_left" AS stock_location_parent_left,

     stock_location."parent_right" AS stock_location_parent_right,

     stock_location."create_uid" AS stock_location_create_uid,

     stock_location."create_date" AS stock_location_create_date,

     stock_location."write_date" AS stock_location_write_date,

     stock_location."write_uid" AS stock_location_write_uid,

     stock_location."comment" AS stock_location_comment,

     stock_location."chained_delay" AS stock_location_chained_delay,

     stock_location."chained_company_id" AS stock_location_chained_company_id,

     stock_location."active" AS stock_location_active,

     stock_location."posz" AS stock_location_posz,

     stock_location."posx" AS stock_location_posx,

     stock_location."posy" AS stock_location_posy,

     stock_location."valuation_in_account_id" AS stock_location_valuation_in_account_id,

     stock_location."partner_id" AS stock_location_partner_id,

     stock_location."icon" AS stock_location_icon,

     stock_location."valuation_out_account_id" AS stock_location_valuation_out_account_id,

     stock_location."scrap_location" AS stock_location_scrap_location,

     stock_location."name" AS stock_location_name,

     stock_location."chained_location_id" AS stock_location_chained_location_id,

     stock_location."chained_journal_id" AS stock_location_chained_journal_id,

     stock_location."chained_picking_type" AS stock_location_chained_picking_type,

     stock_location."company_id" AS stock_location_company_id,

     stock_location."chained_auto_packing" AS stock_location_chained_auto_packing,

     stock_location."complete_name" AS stock_location_complete_name,

     stock_location."usage" AS stock_location_usage,

     stock_location."location_id" AS stock_location_location_id,

     stock_location."chained_location_type" AS stock_location_chained_location_type


     "public"."iqcirugia" iqcirugia INNER JOIN "public"."iqcirugia_location" iqcirugia_location ON iqcirugia."id" = iqcirugia_location."cirugia_id"

     INNER JOIN "public"."stock_location" stock_location ON iqcirugia_location."location_id" = stock_location."id"

WHERE $X{IN, iqcirugia.id, PIDS}


Sorry for my english.


I appreciate any help.


Best regards

Juan Sallent



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/24/14, 11:02 AM
Seen: 1646 times
Last updated: 3/16/15, 8:10 AM