Jump to content

Oracle Stored Procedure


ramandeep1980

Recommended Posts

Hi Sherman and Everyone,

Can someone mention clearly how can I use Oracle  Stored Procedure in Jasper Reports.No Where it is mentioned clearly. Most of the links provided for downloading of some JAR file which may solve the purpose is not working. I have checked in Latest edition of  ultimate guide for jasper reports too but just the name of stored procedure is there, nothing helpful though.

I am working in iReport 3.5.3 version.

Kindly let me know how to move ahead

Regards,

Raman

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

 I was able to call an Oracle Stored procedure by doing the following:

1) Set the Query language in the Report Query to plsql

2) Use the following syntax for the call "{call MyPackage.MyStoredProc($P{Cursor},$P{InputParam})}"

3) Define the Cursor param as java.sql.ResultSet

4) Type in the Fields of the result set by hand. I could not get the Automatically Retrieve Fields to work. 

I am using iReport 3.7.1 on Windows XP which is bundled with the jasperreports-extensions-3.5.3.jar that contains the necessary PlSqlQueryExecuter classes.

There was no need to follow the method described by Brian Burridge that made use of a temp table.

Chris



Post Edited by cshaw at 04/08/2010 17:39
Link to comment
Share on other sites

  • 4 weeks later...

Thanks cshaw! It was what we looking for!

Just for the complete solution. You can register the mentioned executer factory by:

net.sf.jasperreports.engine.util.JRProperties.setProperty("net.sf.jasperreports.query.executer.factory.plsql", "com.jaspersoft.jrx.query.PlSqlQueryExecuterFactory");

After registration you can use:

InputStream is = getClass().getClassLoader().getResourceAsStream("jrreports/CursorTest.jasper");
JasperPrint print = JasperFillManager.fillReport(is, new HashMap(), conn);

 

Link to comment
Share on other sites

  • 5 months later...

Code:
Huraaaaa. I was searching for this for few hours. Indeed it works. Thank you.

 

Post Edited by pezajr at 10/14/2010 13:59

Code:
[code]Huraaaaa. I was searching for this for few hours. Indeed it works. Thank you cshaw.

 

Post Edited by pezajr at 10/14/2010 14:01

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...