gushie Posted April 24, 2008 Share Posted April 24, 2008 I have my own jar file containing a Scriptlet class (extends JRDefaultScriptlet) which I share across many reports. I've produced a report, with parameters, which accesses these scriptlets in the usual manner $P{REPORT_SCRIPTLET}.myFunction() and I set the scriptlet class in the report properties in iReport. My scriptlet jar file is in the WEB-INF/lib folder on jasperserver I've uploaded the report into the Ad Hoc Components/Topics folder. If I run this report on the server via the Repository then it works great, and finds/runs the scriptlet methods without any problem. However when I attempt to run the report via the Ad Hoc Editor, then it loads the fields OK, I choose some and click run. I get an error: The method myFunction() is undefined for the type JRAbstractScriptlet value = (java.lang.String)(((net.sf.jasperreports.engine.JRAbstractScriptlet)parameter_REPORT_SCRIPTLET.getValue()).myFunction()); //$JR_EXPR_ID=1$ How do I get the Ad Hoc editor to refer to my class? I've tried uploading the JAR file as a resource file to the report as well, but it made no difference. Thanks.Post edited by: gushie, at: 2008/04/24 10:05 Link to comment Share on other sites More sharing options...
mgeise Posted August 4, 2008 Share Posted August 4, 2008 Ad Hoc does not preserve the scriptletClass from the topic. In fact, Ad Hoc topics have a finite set of supported attributes since the ad hoc feature is geared towards fast report development for non technical users. For reports that requires scriptlets, they would have to be created in iReport and deployed to the server. Link to comment Share on other sites More sharing options...
jasper-2013 Posted July 18, 2014 Share Posted July 18, 2014 have this feature implemented in new 5.6? 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