Jump to content
We've recently updated our Privacy Statement, available here ×

JasperReports Scriptlet


hussainian

Recommended Posts

Hi!

I want to use a scriptlet class with my JasperReport. Can anyone please tell me how to add it to the class path? Also I read that use the fully qualified name in the Class attribute of SCRIPTLET tag. What if I don't have any package. I mean what if I place the Scriptlet Class file in the same folder where .JRXML file is placed?

Thanks.

Link to comment
Share on other sites

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

Classpath is set so that the jasper engine knows where to find the scriptlet. If your scriptlet is in the same location as your reports, I think you still have to set the path to this folder. You can set the classpath from Tools --> Options Menu. Also make sure that the scriptlet is compiled before you run the reports

 

Link to comment
Share on other sites

Here are both. The thing I'm trying to do is that before report init, a stored procedure will be called, which will fill a table in databse. And then the query if report will fetch data from that table. By now, the report is empty which means that the procedure is not called and the table is not populated.

Thanks for help.

Link to comment
Share on other sites

I changed the code. And now it is like

 

<jasperReport xmlns="ht... scriptletClass="f1.f2.TestScript">

<scriptlet name="TestScript" class="f1.f2.TestScript"/>

 

I've a jar file added in the iReport Classpath which has the Class file in the hierarchy written above. Still not working.

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