2004 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: anavarro - anavarrog Reference the scriptlet from datasource 2005-11-24 03:40 I have the CSVDataSource class that implements net.sf.jasperreports.engine.JRDataSource and a class com.reports.Scriptlet. I need to accede to the scriptlets in the method next(). For it I need a reference to the object scriptlets. At the moment I do the following thing: In the method beforeReportInit() of the scriptlets I obtain datasource and I establish a reference to him to the this one object. Being of the following way: public void beforeReportInit() throws JRScriptletException { // System.out.println("Scriptlet:beforeReportInit"); CSVDataSource ds = (CSVDataSource)this.getParameterValue("REPORT_DATA_SOURCE"); ds.setScriptlet(this); } The problem is that this solution forces to me to put a empty registry so that can be acceded from datasource to the scriptlets, since is after the first call to the method next() of datasource when beforeReportInit() of the scriptlets is executed. As it could obtain a reference to scriplet from datasource before running first next()? How can I access the scriptlet object from the method next() from my custom JRDataSource? 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