Simple Java Rest client for Jasperserver 4.5 and Above
Java
Latest commit a0d00c0 Sep 26, 2014 @dersteppenwolf dersteppenwolf Update README.md
Permalink
Failed to load latest commit information.
src Add Readme info May 18, 2012
README.md Update README.md Sep 26, 2014
pom.xml First Version May 16, 2012

README.md

jasperserver-simple-java-rest-client

Notes

This is an outdated approach to use jasperserver's REST capabilities.
You can find the official Jasperserver Rest project here : https://github.com/Jaspersoft/jrs-rest-java-client

Overview

A Simple Java Client for Jasperserver 4.5 (and Above) that uses the Web Service API based on the REST framework

In simple words, you can run a report published in a remote server and retrieve the generated file (pdf or excel) to a local folder.

You will need maven 3 (http://maven.apache.org/) to build this library.

This library is created by Kudos Ltda.

Sample Usage

View (src/test/java/com/gkudos/jasperserver/client/JasperserverRestClientTest.java)

The following unit tests are available:

  • testGetReportAsFile
  • testGetBigReportAsFile
  • testGetBigReportAsExcelFile
  • testGetReportWithParamsAsFile

Execute a report without parameters:

Report report = new Report();
report.setUrl("/reports/samples/Employees");
report.setOutputFolder(outPutDir.getAbsolutePath());
JasperserverRestClient client = JasperserverRestClient.getInstance(serverUrl, serverUser, serverPassword);
File reportFile  = client.getReportAsFile(report);

Execute a report with parameters:

Report report = new Report();
report.setUrl("/reports/samples/Department");
report.setOutputFolder(outPutDir.getAbsolutePath());
report.addParameter("department", "11");
JasperserverRestClient client = JasperserverRestClient.getInstance(serverUrl, serverUser, serverPassword);
File reportFile = client.getReportAsFile(report);

License

You are free to use it for any of your projects without restriction. License: MIT http://www.opensource.org/licenses/mit-license.php