Jump to content

Is it possible to publish a japser report (JRXML file) with command line prompt ?

Go to solution Solved by arnaudsimon091,

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

Hi jean-pierre !

You can publish reports with the REST API,  go to this documentation (https://community.jaspersoft.com/wiki/how-use-rest-v2-upload-report-unit-jasperreports-server-base64-encode-approach) for more information.

Example of a shell script right here : 

#put all the jrxml into a variable

JRXML_DATA_1=$(cat ../select_acti.jrxml) 

#curl command to publish the jrxml file

curl  -X POST http://your_server:8080/jasperserver-pro/rest_v2/resources/path_where_you_want_to_put_the_report -H "Content-Type:application/jrxml" -H "Content-Disposition:attachment; filename=name_of_the_jrxml_file" -H "Content-Description:your description" -d "$JRXML_DATA_1" --user username:password

#load a reportUnit into a variable :

RESOURCEDESCRIPTOR_XML_1=$(cat ../select_acti_reportUnit.xml)

#curl command to create the reportUnit

curl -X POST http://your_server:8080/jasperserver-pro/rest_v2/resources/path -H "Content-Type:application/repository.reportUnit+xml" -d "$RESOURCEDESCRIPTOR_XML_1" --user username:password


example of reportUnit file : 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Best regards,


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