devilsavocado Posted January 16, 2009 Share Posted January 16, 2009 Hi there,I've gone through the scriptlet sample in Jasper, and I think I've written a scriptlet that should work... my question is how to link the two in iReport so I can preview it? It looks like the sample JR points the jrxml to the .class file in the build.xml- but iReport doesn't ask for a location of the scriptlet, so where would I go to tell it to look for the scriptlet? Or should they both be in the same directory?Thanks! Link to comment Share on other sites More sharing options...
devilsavocado Posted January 19, 2009 Author Share Posted January 19, 2009 Anyone? I have a feeling the answer is easy, but I just can't seem to find it! Link to comment Share on other sites More sharing options...
drlaz Posted January 20, 2009 Share Posted January 20, 2009 Make sure that the scriptlet is in your classpath (under Preferences--this is global to iReport, not just individual report). Then in the Report Properties, put this fully qualified name of the scriptlet. like com.me.mypackage.MyScriptlet. Remember that this should be relative to the classpath entry. Link to comment Share on other sites More sharing options...
devilsavocado Posted January 20, 2009 Author Share Posted January 20, 2009 Thanks for the help. I added the scriptlets to the classpath, and then added the name of the scriptlet like you explained, but I still get the "Cannot find Class Path" error. I also tried to add the original folder that contains the scriptlets to the classpath screen (in iReportNB's Options pane) and that gave the same error as well. Not really sure what I'm doing wrong :-S Thanks again. Link to comment Share on other sites More sharing options...
devilsavocado Posted January 21, 2009 Author Share Posted January 21, 2009 If it helps, this is the beginning of the XML: The Package is Population and the Class is PopulationSorter, I attempted to do scriptletClass="Population.PopulationSorter" but it didn't work either. (This is probably me being a dimwit at Java as opposed to an iReport problem now that you pointed it out to me, I will try to look around a little bit but hopefully someone here can also help me) Link to comment Share on other sites More sharing options...
devilsavocado Posted January 22, 2009 Author Share Posted January 22, 2009 oops, guess it didn't transferCode:<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Population" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" scriptletClass="Population"> 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