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

Copy reportUnit in Jasperserver using REST API


S Atah Ahmed Khan

Recommended Posts

Hi Everyone,

I want to copy a repotUnit then need to change its content in java.

In SOAP API we have direct copy method, it was quite easy for us to copy any resource.

Since we are migrating to REST API, i am unable to copy a reportUnit. Also when i read the guide, haven't found anything.

I have gone through the code of Jasperserver source code which i downloaded from Source forge, Also , there are some test cases given but those are not working.

Lateron i tried to create a new ReportUnit. But it too got failed.

 

Any help is appreciated.

Thanks.

May The Creator bless all of us.

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hello S Atah Ahmed Khan

Sorry for a belated response. Actually there is a possibility to copy a resource, particularly a Report Unit, to any folder using REST. Given that you are logged in as some administrator, perform the following POST request:

http://host:port/jasperserver/rest/resource/uri/to/resource?copyTo=%2Furi%2Fto%2Fdestination

Like this one:

http://localhost:8080/jasperserver/rest/resource/reports/samples/AllAccounts?copyTo=%2Fpublic%2FAllAccounts

Please note that slashes '/' in copyTo parameter are URL-encoded as %2F. If you're going to copy a resource, you have to specify the full path to the new resource along with its new ID, not just the folder where to copy the resource to. If you are copying an entire folder, you also specify the new path of the clone of this folder, not the parent folder under which your copied folder would be placed.

Also please don't forget to check whether your desired permissions for the copied resource/folder are preserved. This functionality is not documented for a while already (however we use it for internal purposes), so there may be reasons for this like some flaws in the service or some uncertainty. Please make sure everything works okay for you and no security breaches (e.g. unpreserved permissions) appear.

Let me know if it works for you.

Thanks for using our Community Portal.

With best regards,
Paul Danyliuk

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