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

Jasper Studio -creating a custom expression function -how to implement on JasperReports server?


npickard

Recommended Posts

I'm using Jaspersoft Studio 5.5 and Jasper Reports server 5.2 .  In studio, I've created a custom function (http://community.jaspersoft.com/wiki/jaspersoft-studio-expression-editor-how-extend-it-and-contribute-your-own-functions-part-2-0)  that shows up in the expression editor.  I've created a jar file from this, added it to the classpath of Jaspersoft Studio -and bingo! -I see my custom function in the expression editor.  I think it's fine; using preview, it works in studio and I can confirm the custom expression function is correct.

I have then populated my report to the server, and of course, the report doesn't work as it does not know about this custom function.  So, I uploaded my jar file as a resource and created a link to this jar file in the report using the server web gui, as well as adding this as a resource to the report (again from the web gui).  However, it still does not work.....

So I have some questions:

i. Is this the appropriate way to add custom functionality using a jar file for custom functions referenced in a text field of a report?

ii. Can I do all this via Studio to update the server (couldn't find anything about it), or do I need to explicity do this at the server side?

iii. Assuming my jar file is correct (and I assume it is as it works in studio)  where do I need to put this?  Can I use the server web gui to do this?  Or do I need to copy it via a command line?  Is there a directory on the server I should be copying this jar to?

Any suggestions and advice would be welcome!

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,
I think you should use JRS 5.5. I do not know exactly how JRS 5.2 was packaged but I'm pretty sure it does not have the jar needed to recognize and make the custom expressions work fine. The tutorial is specific for the 5.5 version, if you give a look at the article tags. Using JRS 5.5 you should find in the server installation the "jasperreports-functions-5.5.0.jar" that is mandatory. In JSS you see it among the JasperReports Library entry of your classpath configuration.

Regards,
Massimo.

 

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