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
2 Answers:
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 https://www.youtube.com/watch?v=ykeXTsQFBC4
- 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#Scri...
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