Jump to content
Changes to the Jaspersoft community edition download ×

Scriptlets


clive.haynes_1

Recommended Posts

Is is possilble to have a definitive set of instructions of how to use scriptlets from within Jaspersoft studio. As from one hour to the next I can have it working and then it fails. it is difficult to develop a solution when the product behaves differentlyeach time you start it

Regards

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Can you be more specific on how are you using the scriptlets and how they behave differently form one time to the next? If you can post an example it will  be great.
 

Here are some good examples and tutorials on how scriptlets work: 
http://community.jaspersoft.com/blog/all-you-want-know-about-scriptlets there is also a video about this one 


http://www.tutorialspoint.com/jasper_reports/jasper_report_scriptlets.htm

And of course there is nothing like the docs:
http://jasperreports.sourceforge.net/sample.reference/scriptlet/ and http://community.jaspersoft.com/wiki/jasperreports-library-tutorial#Scriptlets

Link to comment
Share on other sites

  • 3 weeks later...

The problem is that if I follow the same steps for creating a scriptlet from one project to another, then it is a lottery whether the the exact same script is going to to work, more often than not it fails. Maybe after some hours or redefining the scriptlet in the jasper report it might work just once and then fail.

The error I keep getting is as follows

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error loading scriptlet class : MyTest
 at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:467)
 at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$18(ReportControler.java:442)
 at com.jaspersoft.studio.editor.preview.view.control.ReportControler$4.run(ReportControler.java:334)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: net.sf.jasperreports.engine.JRException: Error loading scriptlet class : MyTest
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(DefaultScriptletFactory.java:114)
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriplets(DefaultScriptletFactory.java:89)
 at net.sf.jasperreports.engine.fill.JRFillDataset.createScriptlets(JRFillDataset.java:507)
 at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:626)
 at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:433)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:508)
 at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:120)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: MyTest
 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:175)
 at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(DefaultScriptletFactory.java:109)
 ... 7 more

 

This is why I am looking for something that is stable

Regards

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