How to publish custom functions from Jasper Studio to the Jasper Server

Hello, I was able to create custom functions in Jasper Studio, and they work on my computer when I test the reports.  But when I published the report to the Jasper server I get an error like this


Errors were encountered when compiling report expressions class file: 1. The method CURRENT_MONTH_BEGINNING() is undefined for the type TotalTaskHrsOnly...


What is the proper way to include the custom functions that I made, so that the report works when making a request to the Jasper server?  If anyone can provide me with a tutorial on how to do this, that would be great. Thank you

ericb_1's picture
Joined: Jun 22 2015 - 12:05pm
Last seen: 2 years 10 months ago

The reason why my custom functions were not working was because I did not export the 2 properties files that are generated when creating new library functions.


The steps that I took to add my new functions to the Jasper server are here:

  • Create the jar file. Right click on your Jasper project in Jasper Studio, and select Export

  • Click on the src folder and check the file

  • Click on the package folder and select everything inclucing the file

  • Pick the destination folder to export the new .jar file to and click finish. 

Once the jar file is exported, you will need to log into the Jasper Server, and add the jar file as a resource to the report

  • Log into Jasper Server
  • Select your report, and click Edit
  • Click Controls & Resources
  • Click Add Resource

  • Select Upload a Local File and locate the jar file that you exported from earlier

  • Edit your resource Name and Resource ID, then click Next on the bottom of your browser.
  • Note - The resource name and id are defaulted to be the same

  • Make sure your jar file has been added to the Resources in the Controls & Resources page, then click Submit
  • Note - The devhours.jar in the image below is the Name and Resource ID that I gave it. Your resource may be called something else 


Hopefully this helps others who may have had problems adding custom functions to the Jasper Server.

ericb_1 - 4 years 10 months ago

2 Answers:

Take a look at this question. You need to export your custom function as jar file and uploading the jar file to JasperReports Server.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 8 months ago

Using scriplets works well for me.

Take a look at:


mlopez_1's picture
Joined: Oct 21 2013 - 8:08am
Last seen: 6 days 2 hours ago