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

how to store & compile scriptlet inside iReport


law

Recommended Posts

Hi all,

I have a small test scriptlet with one method returning a string. I'm not sure how to store the scriptlet in the report or build it.

Here is what I have in the scriptlet:

import net.sf.jasperreports.engine.JRDefaultScriptlet;
import net.sf.jasperreports.engine.JRScriptletException;
public class TestScriptlet extends JRDefaultScriptlet {
     public String testDescription() throws JRScriptletException
     {
         return "Hi there!";
     }
}

 

When I build the scriptlet from a command prompt, I get errors for import statements in the scriptlet:

TestScriptlet.java:2: error: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.JRDefaultScriptlet;
                                  ^
TestScriptlet.java:3: error: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.JRScriptletException;
                                  ^
TestScriptlet.java:5: error: cannot find symbol
public class TestScriptlet extends JRDefaultScriptlet {
                                   ^
  symbol: class JRDefaultScriptlet
TestScriptlet.java:6: error: cannot find symbol
 public String testDescription() throws JRScriptletException
                                        ^
  symbol:   class JRScriptletException
  location: class TestScriptlet
4 errors
 

If anyone has some experience with this, your help will be much appreciated!



Post Edited by liw at 08/14/2012 16:48
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...