npickard Posted March 24, 2014 Share Posted March 24, 2014 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 More sharing options...
Massimo Rabbi Posted March 24, 2014 Share Posted March 24, 2014 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 More sharing options...
npickard Posted March 24, 2014 Author Share Posted March 24, 2014 Massimo, thanks so much for the reply. So pretty much it looks like I have to have compatible versions of Jasper Reports Server and Jasper Studio. Link to comment Share on other sites More sharing options...
hozawa Posted March 24, 2014 Share Posted March 24, 2014 You should be using the same version of JSS and JRS. I usually also just add the jar directly into the JRS lib directory so the classes will be able to all the reports in all organizations. The downside of this is that I need to restart the JRS. Link to comment Share on other sites More sharing options...
npickard Posted March 26, 2014 Author Share Posted March 26, 2014 Hozawa, thanks for the response. I've actually got the same versions now -I assume you can't copy that jar using the server web gui interface or Jasper Studio? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now