Hello World Scriptlet Example:Error "cannot be resolved to a type"

0

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)

dstevens_2's picture
Joined: Jun 20 2017 - 8:32am
Last seen: 2 weeks 3 days ago

5 Answers:

-1

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.

vchiem's picture
7210
Joined: May 1 2017 - 5:33pm
Last seen: 1 day 8 hours ago
0

Thank you for the swift response.

I think the problem is configuring my jar files, and this particular tutorial doesn't cover that part.

If you have any good references for the configuration step I'd greatly appreciate that.

dstevens_2's picture
Joined: Jun 20 2017 - 8:32am
Last seen: 2 weeks 3 days ago
0

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.

vchiem's picture
7210
Joined: May 1 2017 - 5:33pm
Last seen: 1 day 8 hours ago
0

I had the same problem dstevens_2, I restarted my Jaspersoft studio and eveything worked fine ! 

 

arnaudsimon091's picture
Joined: Nov 26 2018 - 12:25pm
Last seen: 20 hours 49 min ago
0

 

vchiem u should remove that video, having a .java in the build path simply doesn't work, that's a big lie, we all have the same error XXX cannot be resolved to a type 

firuzzz's picture
45
Joined: May 17 2012 - 5:03am
Last seen: 1 month 4 weeks ago
Feedback
randomness