0.0
No commit activity in last 3 years
No release in over 3 years
The JRuby Reports Server for JasperReports
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.5.0

Runtime

 Project Readme

Casper Server

What is this?

Casper Server is a Sinatra Web Server that provides an interface to the Casper Reports library.

With this server you can send a jrxml template, a xml document and a xpath string.

Install Gem

gem install casper_server

Requirements

  • Java
  • JRuby
  • Rack
  • RVM

How do I create a Casper Server?

casper-server [name]

How do I run the Casper Server?

cd [name]
rackup

API

POST / {content-type:application/json}
#body=>
{ 
  "casper": 
  {
    "jrxml": <base64 encoded jrxml document>,
    "data": <base64 encoded xml document>,
    "xpath": <xpath query string>
    "type": ('pdf','xls')
  }
}

(XML VERSION CURRENTLY NOT WORKING!!! - should be implemented in 0.2.0)

POST / {content-type:application/xml}
#body=>
<casper>
  <jrxml><![CDATA[{insert jrxml document here}]]></jrxml>
  <data><![CDATA[{insert xml document here}]]></data>
  <xpath><![CDATA[{insert xpath string here}]]></xpath>
  <type><![CDATA[{'pdf' or 'xls'}]></type>
</casper>

#RESPONSE=>
<pdf>
  <base64><![CDATA[{base64encoded pdf string}]]></base64>
<pdf>
  
---

TEST

GET /


On the web page you will be presented with three inputs and a process button.

The first input will be requesting the jrxml file
The second input will be requesting the xml document
The third input will be requesting xpath query string
The fourth input will be requesting the report type (pdf, xls)

Click Generate Report, and a pdf/xls should stream to your browser.