Sha256: 0acbbfa7b5636b73ee4f52bb772e5edbcc9efe06b15872b120868112d2a1fe8e

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

[Query report](http://ashrafuzzaman.github.io/query_report/) By [Ashrafuzzaman](http://ashrafuzzaman.github.io/site).

[![Build Status](https://api.travis-ci.org/ashrafuzzaman/query_report.png?branch=master)](http://travis-ci.org/ashrafuzzaman/query_report)

Query report is a reporting tool, which does the following:

* Generate paginated HTML view with filters, defined columns with sorting
* Generate PDF, CSV, JSON
* Provide feature to define re usable custom filter

As built in filter I have used [ransack](https://github.com/ernie/ransack) and pagination with [kaminari](https://github.com/amatsuda/kaminari)

For a demo see [here](http://query-report-demo.herokuapp.com)

## The purpose
The purpose of this gem is to produce consistent reports quickly and manage them easily. Because all we need to
concentrate in a report is the query and filter.

## Getting started
Query report is tested with Rails 3. You can add it to your Gemfile with:

```ruby
gem "query_report", "~> 1.0.4"
```

Run the bundle command to install it.

Here is a sample controller which uses query report. And that is all you need, query report will generate all the view for you.

```ruby
require 'query_report/helper'  #need to require the helper

class InvoicesController < ApplicationController
  include QueryReport::Helper  #need to include it

  def index
    @invoices = Invoice.scoped

    reporter(@invoices) do
      filter :title, type: :text
      filter :created_at, type: :date, default: [5.months.ago.to_date.to_s(:db),
                                                 1.months.from_now.to_date.to_s(:db)]
      filter :paid, type: :boolean, default: false

      column :title do |invoice|
        link_to invoice.title, invoice
      end
      column :total_paid
      column :total_charged
      column :paid
    end
  end
end
```

## License
MIT License. Copyright © 2013 [Ashrafuzzaman](http://ashrafuzzaman.github.io/site). See MIT-LICENSE for further details.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
query_report-1.0.10 README.md
query_report-1.0.9 README.md
query_report-1.0.8 README.md
query_report-1.0.7 README.md
query_report-1.0.6 README.md
query_report-1.0.5 README.md