Jump to content

Compiling a scriptlet


fluffyspike

Recommended Posts

Hi, Im completely new to JasperReports and iReport but at my job i have been given the task of amending reports the company already deploys. I have been given an ex-employee's access to his backup drive. However I am having a hard time setting up on my local machine. I am wondering if you guys could help me?

 

The directory he left me contained:

  • iReport 2.0.4
  • The report.jrxml which I can load successfully in iReport 2.0.4
  • A scriptlet.java which simple queries a database and returns variables in a hasmap
  • A compiled version of the scriptlet.java called scriptlet.class

 

Now, when I set everything up. I have successfully created a database connection, setup the classpaths. Including putting the tools.jar from the java jdk into the libs directory.

 

 

I put the scriptlet.java in a directory above the jrxml called /jasperReport/ then load up report.jrxml in iReport. I hit compile and it complains of this message:

 

 Compiling to file... C:\Users\SBharath\Documents\Projects\preapp ireport\preapp_test.jasper -> C:\Users\SBharath\Documents\Projects\preapp ireport\preapp_test.java net.sf.jasperreports.engine.design.JRValidationFault@78cbab java.lang.ClassNotFoundException: PreAppointmentScriptlet
Line: 20, Column: 29 JRXML Element: /jasperReport

net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
     1. java.lang.ClassNotFoundException: PreAppointmentScriptlet
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:260)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144)
    at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:588)
    at java.lang.Thread.run(Unknown Source)
Compilation running time: 656

 

If I use the previously compile scriptlet.class, the report works fine!

 

I do realise there is a far later version of iReports 3.5.0, which I have tried however I couldnt find the scriptlet editor in this version and also the application complained it couldnt find ireport.jar which I could only find exclusive to version 2.04.

 

My problem is : Where do I put the scriptlet.java in order for iReport to see and compile this file into scriptlet.class?

 

Ive tried to include as much information as I can, I am hoping this is a simple fix, maybe a path is wrong or something but im hoping someone can help me.

Thanks in advance!

 



Post Edited by fluffyspike at 04/24/2009 10:17
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Is the scriptlet a custom class(Since it has a different name then your report it probably is)?

To compile it you need to go to the command line and manually compile it or setup an ide (I like eclipse) and use this.

It looks like you are having trouble referencing the class. Check the following

1. classpath

2. Under Report properties -> Scriptlet Class ->

 

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