There is a way of working this out, and it can all be done in Oracle database (which means that it works for any reporting tool). It's a bit complicated, but it works: 1. Create a PL/SQL package in Oracle: create package pk_Report as --these are the fields that are the output of the --query TYPE OUTREC_TYPE IS RECORD ( field1 VARCHAR2(10), field2 number(10), field3 date); TYPE OUTRECSET IS TABLE OF OUTREC_TYPE; FUNCTION F_report(inParam1 varchar2, inParam2 varchar2) RETURN OUTRECSET PIPELINED; end; create package body pk_Report as --this is the procedure that we'd like to call --before the query procedure before_report is --following line is necessary if you want to do some inserts, updates or deletes pragma autonomous_transaction; begin --do some DDL here.... null; end; FUNCTION F_report(inParam1 varchar2, inParam2 varchar2) RETURN OUTRECSET PIPELINED is temp outrec_type; begin --this is where we call before_report procedure before_report; --this is the query from the report: for c in (select field1, field2, field3 from some_table where fied4=inParam1 and field5=inParam2) loop temp.field1:=c.field1; temp.field2:=c.field2; temp.field3:=c.field3; pipe row(temp); end loop; end; end; 2. When you call your procedure from Jasper, do it like this: select * from table(pk_report.f_report('a,'b')) And that's it.