I am trying to follow the tutorial Hello World Scriptlet Example by Sadakar Pochampalli.
After following all the instructions, once i try to compile and run the report i get the error below.
Help greatly appreciated!!
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. com.sadakar.jasper.Test4 cannot be resolved to a type
value = ((com.sadakar.jasper.Test4)parameter_Hello_SCRIPTLET.getValue()).hello(); //$JR_EXPR_ID=8$
<---------------------->
2. com.sadakar.jasper.Test4 cannot be resolved to a type
value = ((com.sadakar.jasper.Test4)parameter_Hello_SCRIPTLET.getValue()).hello(); //$JR_EXPR_ID=8$
<---------------------->
3. com.sadakar.jasper.Test4 cannot be resolved to a type
value = ((com.sadakar.jasper.Test4)parameter_Hello_SCRIPTLET.getValue()).hello(); //$JR_EXPR_ID=8$
<---------------------->
3 errors
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:206)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:294)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.compileJasperDesign(ReportControler.java:465)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$15(ReportControler.java:442)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:356)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
5 Answers:
Theres a nice tutorial video on scriptlets "TIBCO Jaspersoft: Using Scriptlets inside TIBCO Jaspersoft Studio and JasperReports"
https://www.youtube.com/watch?v=t9Hv6DrwrhQ&t=6s&index=1&list=PLRran9THV...
Maybe this can help you determine where it went wrong.
I remembered getting issues following this example too... whether or not its exactly this error but I think it was similar.
I believe there's a mistake in one of the steps..
3) Add Jasper Server jar file to Project Path
This step applies to the Java project.. The jar file mentioned is 'Jar File Name : jasperreports-pro-6.0.0.jar' but this is not right. It should be jasperreports-6.3.0.jar (for 6.3) or jasperreports-6.2.0.jar as per the screenshot in the following step.
As my Studio is not where the server is, I copied the jasperreports-6.3.0.jar from server and place it locally and load that in the project path.
Step 5 and 6a are important. Once you have exported your test.jar, step 6a should be done for "MyReports" not for the java project.