thegg Posted February 17, 2011 Share Posted February 17, 2011 Hi all, and thanks by advance for your help...I'm elaborating a report with ireport 4.0 and I need to do a scriptlet.My java skill isn't very good and I passed 2 days to turn around the subject on this forum and others but... that doesn't work... 1 - The downloaded scriptlet sample, don't work ! I have put the tools.jar in the 4.0 directory lib and in the classpath.. But designer still indicate a java.lang exception on a style object ... :(2- I have installed the ultimate netbeans+java pack and now how I can integrate the jasper lib to this IDE ? Because I want to create a special library to get out my scriptlet problems... Thx (Edit) PS : I have seen littles words about a scriptlet editors (old version) and a netbeans plugin about scriptlet any complementary news ?TheGGIreport 4.0 - NetBeans 6.9.1 - JDK 1.6 - (JasperReport 4.0 in a corner of my disk)Post Edited by thegg at 02/17/2011 17:09Post Edited by thegg at 02/17/2011 17:18 Link to comment Share on other sites More sharing options...
thegg Posted February 18, 2011 Author Share Posted February 18, 2011 ok, I had need one more day and a night to help me to resolve the second part of my problem.So1 : I taking the plugin for netbean and installed it by the netbeans plugin interface.2 : downloaded the jasper 4.0.0 and installed on a library (api folder, doc folder, lib/comon*.jar and jasper*.jar)3 : tested to build a class with JRDefaultscriptlet and JRScriptletException and a public fonction returning a simple string.The build don't up error so I consider that 's okBut in the report... Continue to didn't workI proved to : add my class jar into the ireport lib add my class jar into the classpath list add my class jar into the same directory of the jrxmlThx per advance to your advice. Link to comment Share on other sites More sharing options...
thegg Posted February 22, 2011 Author Share Posted February 22, 2011 Hi all, I think I turn around a mistake but I don't find any clues.So here the class : Uds4LibScriptlet.classpackage uds4ireport;import net.sf.jasperreports.engine.JRDefaultScriptlet;//import net.sf.jasperreports.engine.JRAbstractScriptlet;//import net.sf.jasperreports.engine.JRScriptletException;public class Uds4LibScriptlet extends JRDefaultScriptlet{ public String GetImagePath(String Field) { return "foo string"; }} In the properties of my jrxml :scriplet class = Uds4LibScriptletlanguage=javaImports=uds4ireport classpath of ireport options :<javapath>JDK1.6.0_23\lib<javapath>JDK1.6.0_23\bin<javapath>JDK1.6.0_23\lib\tools.jar<ireport-4.0path>\libs\tools.jar<jasper4.0path>\dist\jasperreports-4.0.0.jar<path of my package>\dist\uds4ireport.jar in the jrxml I have only a field with :$P{REPORT_SCRIPTLET}.GetImagePath("")result :java.lang.classNotFoundException: Will not load classes from default package (Uds4LibScriptlet) in styles Object...If I copy-past my Uds4LibScriptlet.class in the jrxml directory I don't have anymore the message but the preview do nothing :(. Where I have wrong please ? Thx for your future advices The GG 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