== What is it?
ruport-util provides a home for marooned former parts of Ruby Reports,
and newer fringe ideas.
== Examples of new stuff
csv2ods and Ruport::Formatter::ODS
ruport-util now comes with a tool called csv2ods which will convert a
csv file to an OpenDocument spreadsheet file. You do not need
OpenOffice.org installed to use this tool.
– usage:
csv2ods my.csv my.ods
This is simply implemented as a Ruport table formatter, so you can use
it programatically, too.
For example, if you’re reporting against an ActiveRecord model
class MyModel
acts_as_reportable
end
MyModel.report_table(:all,:conditions => [“name = ?”, “Fat
Louie”]).to_ods
Streamlined Report class
Our report runner has been simplified and many dumb features were cut
out of it.
One cool new feature is implicit file type handling:
#------
class MyReport < Ruport::Report
renders_as_table
attr_accessor :file
def renderable_data
t = Table(file)
t.sub_table { |r| r.a == “foo” }
end
end
MyReport.generate do |report|
report.file = “in.csv”
report.save_as “out.csv” # renders to csv
report.save_as “out.pdf” # renders to pdf
puts report.to_text # renders to screen as text
end
#-----
rope has been updated to generate the new Report definitions.
== Getting Ruport
To use ruport-util, you’ll need Ruport >= 0.12.0
sudo gem install ruport -y
== Installing ruport-util
It’s on RubyForge:
gem install ruport-util -y
== Using
require “ruport”
require “ruport/util”
then just use whatever tools you want.
== Full Feature List as of 2007.06.07:
- Basic Graphing (util/graph)
- Report runner (util/report)
- Report Mailing (util/mailer)
- Report Manager (util/report_manager)
- Invoices (util/invoice)
- PDF form helpers (util/pdf/form)
- ODS formatter for tables (util/ods)
- Benchmarking Tool (util/bench)
- Ruport centric code generation via the rope command.
- csv to OpenDocument conversion via csv2ods
See example/ for more information
== Help?
This code is unstable, evil, and possibly buggy until further notice.
Please report any problems on the Ruport mailing list:
http://list.rubyreports.org