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

Scriptlets in JasperServer


zerglicious

Recommended Posts

I have a report with a Scriptlet which works fine in IReport but is failing validation on JasperServer because JasperServer can't find the scriptlet class on the classpath. I built the JasperServer from the source so it will be easy enough to put the scriptlet class in the /WEB-INF/classes directory but I was trying to upload the scriptlet as a jar in the JasperServer console. Is this the proper procedure for reports with Scriptlets?
Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

zerglicious wrote:

Is this the proper procedure for reports with Scriptlets?

 

Yes, report scriptlets should be deployed into JasperServer report unit jar resources. You can see a working example in the /reports/samples/SalesByMonth report unit from the JS samples.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 1 year later...

 could you explain how this works a little more, please?

In the SalesByMonth sample report i see this line:

scriptletClass="test.TestScriptlet"

as an attribute in the JasperReport tag. What is the significance of the "test." piece of the string?

Link to comment
Share on other sites

Hi

I tried a lot to make Scriptlet working in iReport but no luck. Every time when i add jar to the classpath and run the report it shows nothing also no error. How do you make scriplet can you  explain me the steps for creating it in iReport.

 

Vishal



Post Edited by vishal29bhp at 05/27/2009 10:11
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

 The sample reports are all well and good, but they tell nothing of where the scriptlets are supposed to go within JasperServer. In fact, i've found very little documentation in terms of how JasperServer works behind the scenes. I'm just looking for a directory structure type of view for the report templates, scriptlets, et. al.

Link to comment
Share on other sites

You package the scriptlets as a JAR and put them in the JasperServer repository, not on the file system related to the WAR.

 

Then you add the scriptlet JAR as a "resource" to the report unit definition.

 

When you run the report, the scriptlet JAR is pulled from the repository and added to the server classpath temporarily.

 

 

Sherman

Jaspersoft

Link to comment
Share on other sites

  • 1 year later...

Steps to use Scriptlets in Jasper Server:

-----------------------------------------

1.Fist create scriptlet for which you want to use.

2.create a jar file for that scriptlet

3.create a report set the class path of jar file

4.use that scriptlet in your iReport report like:{SCRIPTLET}.functionname();

5.put that Scriptlet class in scriptletClass="test.TestScriptlet"

6.add this iReport to the JasperServer and place this jar file in add input contrtoller in the jasperserver

Link to comment
Share on other sites

  • 2 weeks later...

prasad23
Wrote:

Steps to use Scriptlets in Jasper Server:
-----------------------------------------
1.Fist create scriptlet for which you want to use.
2.create a jar file for that scriptlet
3.create a report set the class path of jar file
4.use that scriptlet in your iReport report like:{SCRIPTLET}.functionname();
5.put that Scriptlet class in scriptletClass="test.TestScriptlet"
6.add this iReport to the JasperServer and place this jar file in add input contrtoller in the jasperserver

 

already done! but when  run the repo on jasperserver i get a  "The report is empty." message!

in the other hand i run it on Ireport and get the report  ok!

some idea what is happening?

Link to comment
Share on other sites

  • 2 years later...
  • 5 years later...

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