Brokenbone Posted January 11, 2008 Share Posted January 11, 2008 Hi all! I'm new to JasperReports and I've been using it for a month now without any major problems. Now I ran into one I can't solve. For the purpose of some kind of custom SELECT auditing I have to call a procedure (INSERT some records) from the result set into the database. I'm using JDeveloper and have a method for shoving reports that loads compiled report from some location, fill the report with some parameters and export report to PDF. Is there a way somewhere in between to get the result sets from the report, because I would need the values of one column from every record shown in my report, and than call some stored procedure with this values? Thank you in advance!BB Link to comment Share on other sites More sharing options...
lucianc Posted January 11, 2008 Share Posted January 11, 2008 Brokenbone wrote:Is there a way somewhere in between to get the result sets from the report, because I would need the values of one column from every record shown in my report, and than call some stored procedure with this values? Try using a scriptlet, which would give you access to the report field values. Regards,Lucian Link to comment Share on other sites More sharing options...
Brokenbone Posted January 11, 2008 Author Share Posted January 11, 2008 Hi Lucian! Thanks for your suggestion but I'm pretty new to Java too. :blush: I've red the documentation on scriptlets and tried to run the scriptlet example from the samples page. I can't get even this working. When I compile the report without changing it it anyhow I get the ClassNotFoundException. Even if I set the Scriptlet property of the document to Use iReport internal scriptlet support, I still have the same error. Found the thread with the same problem on forum but without a solution. Maybe you can point me to some more information on this subject, where could I read some more about Scriptlet property for example, Scriptlet class, maybe some other example or tutorial. Thanks!BB Link to comment Share on other sites More sharing options...
Brokenbone Posted January 14, 2008 Author Share Posted January 14, 2008 Anyone? I'd really like to be able to call a procedure with some query results but can't find any example for using scriptlets. The one I downloaded from downloads page is not working because of above described error. Thanks Link to comment Share on other sites More sharing options...
lucianc Posted January 14, 2008 Share Posted January 14, 2008 Read this article on how to run JasperReports samples. Scriptlets are an advanced JasperReports feature and implementing scriptlets requires (at least) basic Java development knowledge. I'm not sure how iReport handles scriptlets, you might have a better chance of getting answers to iReport related questions on the iReport forum. Regards,Lucian Link to comment Share on other sites More sharing options...
Brokenbone Posted January 16, 2008 Author Share Posted January 16, 2008 Hi Lucian! I've somehow created a scriptlet class which I've compiled in my JDeveloper ViewController project. The problem I now have is the access to the DB to call a stored procedure. Jdev has application module for this, but I can't get a reference to it from my scriptlet class. (Probably the class that is referenced from jasper report has another session or something like this?) Is there a way to get the DB connection in scriptlet class and call DB procedure directly, without the reference to the Model project. I hope I make myself clear enough to get some suggestions. Thanks! Link to comment Share on other sites More sharing options...
lucianc Posted January 17, 2008 Share Posted January 17, 2008 I'm not sure I understand your question (maybe because I don't know anything about JDeveloper). Which DB connection do you want to get hold of in the scriptlet? If it's the report connection, all you have to do isCode:Connection connection = (Connection) getParameterValue(JRParameter.REPORT_CONNECTION); Regards,Lucian Link to comment Share on other sites More sharing options...
Brokenbone Posted January 17, 2008 Author Share Posted January 17, 2008 Hi! Thank you for your help. I've made this work a little different. For someone using JDeveloper it might give some idea if he/she runs at a similar problem. I didn't use any connections, I just wrote the information I need to ProcessScope parameters, which I then used in the class where my report gets filled. This way I can use any ADF/BC elements including application module. Take care!BB Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now