Project

torrone

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby client to JasperReports.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 3.2.3
= 12.3.2
= 1.5.8
 Project Readme

Torrone

Ruby client to JasperReports API.

Currently, only does compilation of JRXML files and generation of PDF reports.

Installation

After installing the gem:

gem install torrone

Usage

Before doing anything, you should configure Torrone:

Torrone::Config.configure do |config|
  config.jasper_dir = "/dir/of/reports"
end

Having a compiled jasper file, you can generate a PDF report:

array_of_bytes = Torrone::Report.generate('emails',
        data: [
          { email: 'foo@bar.com' },
          { email: 'foo2@bar.com'},
          { email: 'foo3@bar.com'}
        ]
)

it returns an array of bytes.

You can also pass a hash of custom/specifics parameters, just like this:

array_of_bytes = Torrone::Report.generate('emails',
        data: [
          { email: 'foo@bar.com' },
          { email: 'foo2@bar.com'},
          { email: 'foo3@bar.com'}
        ],
        params: {'COMPANY_NAME' => 'My company name'}
)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request