pwork Posted October 5, 2009 Share Posted October 5, 2009 Hello, As far as I know, a custom scriptlet class can be linked in a JasperReport object at JRXML report compilation time, using the 'report' tag 'scriptletClass' attribute. For code privacy reasons, I don't wan't some "com.somecompany.SomeCustomScriptlet" value to be set in this 'scriptletClass' attribute. Concerning another JR aspect, information can be hidden, because it's linked at fill time : when passing a subreport, it can be linked to a JRXML file by providing the JASPER file path (no-privacy), or the compiled JasperReport object (privacy). So, since compiler complains at report compile time, is there some way to put this information at JRXML compilation time, not in the JRXML, but through the underlying Java code (JasperCompileManager.compileReport(..)) ? I found no answer on this when searching the forum. Thanks for info :) Post Edited by pwork at 10/05/2009 18:04 Link to comment Share on other sites More sharing options...
pwork Posted October 6, 2009 Author Share Posted October 6, 2009 Ok, I missed a point : the JasperCompileManager "JasperReport compileReport(JasperDesign jasperDesign) throws JRException" method, and the "NoXmlDesign" sample ;)In fact, I do want to use a JRXML design, but only want to input it the scriptlet class to use from the Java layer, before compilation. This can be done with :JasperDesign jasperDesign = JRXmlLoader.load("path/to/jrxml/file");jasperDesign.setScriptletClass("package.to.custom.scriptlet.Object");Alternatively, is there a jasperreports.properties key to set the default scriptlet class ?All things apart, you should maximize the posts title length : atm, it's very hard to properly describe the post subject with all keywords. As as result, the forums searches results may loose accuracy.Solved anyway Post Edited by pwork at 10/06/2009 11:05 Link to comment Share on other sites More sharing options...
lucianc Posted October 8, 2009 Share Posted October 8, 2009 You can write a scriptlet extension to instantiate a script other than the one specified by the scriptletClass attrinbute.A similar solution can be found at http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=64733Regards,Lucian 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