A simple, but efficient, YAML based report generator
Add this line to your application's Gemfile:
gem 'juno-report'
And then execute:
$ bundle
Or install it yourself as:
$ gem install juno-report
The generating reports is based on a YAML file with all rules, wiht the fields and their settings.
Rules are divided by sections, and the basic structure to generates a report is:
# example.yml
body:
settings: {posY: 40, height: 25}
fields:
test_field1: [10]
test_field2: [220]
test_field3: [450, {column: "Named Test Field 3"}]
footer:
label_total: [5, {text: "Total"}]
totalizer: [200, {behavior: count}]
campo4: [450, {behavior: sum}]
The [body] section represents the record which will be iterated to report generating and must have more three rules:
settings (required)
: Defines some configurations for body, like their height and ypos.fields (required)
: Describes each field of record to be iterated.footer (required)
: Drawn at the end of all printed records and calculates fields according behavior parameter.
You may want to print a title every time that a page is created. You simply insert a [page] section.
The [page] section have follow rules:
fields
:
- Edson Júnior (http://github.com/ebfjunior)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request