Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.59 KB

README.rdoc

File metadata and controls

44 lines (28 loc) · 1.59 KB

ActiveReport

This gem is currently in active development. It needs a lot of documentation and test work before it can really be useful.

The goal

Java reporting libraries have a lot of flexibility, but they are verbose, require a lot of manual SQL, and are difficult to maintain.

Ruby reporting libraries are great, but none plug directly in to Rails apps to make it a breeze to add to an existing project. They also don’t have a lot of the advanced features of their Java counterparts (such as JasperReports).

ActiveReport aims to bridge the gap by bringing the power of Java reporting libraries to Rails, using a very simple and familiar interface.

Setup

In your Gemfile:

gem 'active_report', :git => github.com/wilcox-tech/ActiveReport.git

In your config/routes.rb:

mount ActiveReport::Engine, :at => '/reports' # (or wherever you want it)

An example report

class MyAwesomeReport < ActiveReport::Base
  reports_on :orders
  join_with :customers
  date_range_on :orders, :ordered_on
  group :customers, :country
  column :orders, :payment_types, :count => true
end

This will allow you to generate a report by visiting $mountpoint/MyAwesomeReport (or $mountpoint/my_awesome) in your Rails app. The report will contain a listing of countries you have received orders from, and the count of payment types. Something like:

Australia
Credit card      10
Cheque            7

United Kingdom
Cash             11
Credit card       8
Cheque            1

At least that’s the plan. The API and output may look slightly different as development progresses. :)