<img src=“https://secure.travis-ci.org/thinreports/thinreports-generator.png” /> <img src=“https://codeclimate.com/github/thinreports/thinreports-generator.png” /> <img src=“https://gemnasium.com/thinreports/thinreports-generator.png” />
ThinReports is Open Source Reporting Solution for Ruby.
-
ThinReports Editor (GUI Designer)
-
ThinReports Generator (Report Generator for Ruby)
Editor’s features is here.
Design the layout using Editor, then embed values to text field in layout. That’s it!
Ruby, RubyGems, Prawn and Generator.
Generator can be dynamically operated …
-
value of TextBlock
-
image of ImageBlock
-
styles (border, fill, visibility, position, color, font) of shape
-
Japanese OK
-
External characters (Gaiji)
-
Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0
-
JRuby 1.6, 1.7.0 (Only 1.8mode)
Add the following line in your Gemfile:
gem 'thinreports'
Then bundle:
$ bundle
Or:
$ gem install thinreports
Caution: In order to use the Generator, you must need the layout file(*.tlf) created with ThinReportsEditor.
require 'thinreports' report = ThinReports::Report.new :layout => 'report.tlf' # Page 1 report.start_new_page do item(:title).value('ThinReports') end # Page 2 report.start_new_page do |page| page.item(:title).value('Pure Ruby') page.item(:title).style(:color, 'red') end report.generate_file('report.pdf')
Or,
ThinReports::Report.generate_file('report.pdf', :layout => 'report.tlf') do start_new_page page.item(:title).value('ThinReports') start_new_page page.item(:title).value('Pure Ruby').style(:color, '#ff0000') end
report = ThinReports::Report.new :layout => 'list.tlf' report.start_new_page 10.times do |n| report.page.list(:default).add_row do |row| row.item(:no).value(n) end end report.generate_file('list.tlf')
Or,
report.page.list(:default) do |list| 10.times do |n| list.add_row :no => n end end
Since 0.7.5:
report = ThinReports::Report.new :layout => 'list.tlf' 10.times do |n| report.list.add_row do |row| row.item(:no).value(n) end end
More simply,
report.list do |list| 10.times do |n| list.add_row :title => n end end
-
#start_new_page
can be omitted because it is created new page automatically when#list
is called -
id argument of
#list
can be omitted if is :default
-
Rails Template handler for ThinReports DSL: thinreports-rails
Getting Started / Examples / HowTos
Matsukei Co.,Ltd.
-
twitter: @thinreports_org
-
email: thinreports@gmail.com
-
Pull request
-
Feedback from here
See LICENSE file.