How to Deploy/Publish Jasper Report to Jasper Server

来源:互联网 发布:苹果8plus没网络 编辑:程序博客网 时间:2024/06/02 07:28

My favourite way is to use the Jasper Studio Publish function, with this function's help, the IDE would package everything necessary and do the publish job in background.

LESSON 1: Fall Back to SOAP API

By default, Jasper Studio uses REST API to publish jasper report to jasper server, and we always get error as follows:

org.apache.http.client.HttpResponseException: Bad Requestat com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleException(RESTv2ExceptionHandler.java:58)at com.jaspersoft.studio.server.protocol.restv2.ARestV2ConnectionJersey.toObj(ARestV2ConnectionJersey.java:52)at com.jaspersoft.studio.server.protocol.restv2.RestV2ConnectionJersey.addOrModifyResource(RestV2ConnectionJersey.java:352)at com.jaspersoft.studio.server.protocol.ProxyConnection.addOrModifyResource(ProxyConnection.java:283)at com.jaspersoft.studio.server.publish.Publish.publishResources(Publish.java:172)at com.jaspersoft.studio.server.publish.Publish.publish(Publish.java:60)at com.jaspersoft.studio.server.publish.wizard.Publish2ServerWizard$3.run(Publish2ServerWizard.java:273)at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

This is really unpleasant and disappointing, but at last I found the solution, it works for Jasper Report Server 5.6 and Jasper Report Studio 5.6.

In short, the solution is to employ to SOAP API, rather than REST API.

jasper server SOAP

LESSON 2: Create Report Unit

 With this setting, the IDE would package everything necessary and do the publish job in background. Otherwise, you will have to upload the various resources and establish proper references manually. This function is just awesome!

create jasper unit

Reference

[1] jasperreports-server-user-guide_5.6.pdf



0 0