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

JasperReports and Scriptlet's class position


2004 IR Help

Recommended Posts

By: finzic - finzic

JasperReports and Scriptlet's class position

2005-05-10 05:49

Hi all,

I am in the process of evaluating JAsperReports and I need help on where to put *.class files of the scriptlets.

 

In my development process, I create the report using iReports, then I move to my java IDE and create the scriptlet (call it myScriptlet.java) that will handle the various PARAMETERS' use and fill ${VARIABLE}'s .

 

now the tricky part: the *.jasper file needs the myScriptlet.class file to be available at runtime.

 

IMHO JasperReports requires the scriptlet class to be positioned in a path that starts from the directory where the *.jasper file is.

 

Is there any means to specify a different path for the scriptlet class?

 

I need this because the directory layout of my CVS module will be different from the directory layour of the running application.

 

Also, when working with IDE, any time I recompile the file myScriptlet.java, I need to manually copy the file myScriptlet.class to the path (relative to *.jasper's dir) where it should be. this is a great annoyance when (rapidly!) developing! Any idea on how to avoid this class file manual copy?

 

Thank you all in advance!

 

 

 

 

 

 

By: bourridhh - bourridhh

RE: JasperReports and Scriptlet's class posit

2005-05-10 06:26

Hi,

when using a scriptlet class you need to specify the path of the class : package_name.your_scriptlet.class

When using japser there is three steps to run a report

- compile

-Fill

-export

suppose you have a class that will do all of these operations

when compiling a jrxml file the JasperCompileManager generate a temporary java file in the same dir of this class, if you use a scriptlet class this class will be referenced in this java file ,the scriptlet file must be visible to the java class (in his class path)

 

hope it helps

 

 

 

 

 

 

By: finzic - finzic

RE: JasperReports and Scriptlet's class posit

2005-05-10 06:58

Thank you very much, bourridhh,

I tried your suggestion and it worked well!

it's amazing how people from the 2 corners of the world could help themselves thru this magic we call Internet!

Thank you again, and have a nice day!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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