Jump to content
We've recently updated our Privacy Statement, available here ×

Scriptlets and iReportNB


devilsavocado

Recommended Posts

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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

oops, guess it didn't transfer

Code:
<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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...