Viewing file: ruby/reporting/MyReport.rb | Back to directory listing
Author: Loren Segal | Last modified: February 21 2006 12:00 am | Download

class MyReport < Reporting::Base
  layout      'default'
  columns     ['users.id', "ID"], [:first_name, "Full Name"], [:last_name,nil], [:email, "E-mail Address"], [:time, "Order Time"]
  tables      :users, :orders
  conditions  "orders.user_id = users.id"
  
  def format_first_name(row)
    (row[:first_name] || '') + " " + (row[:last_name] || '')
  end
 
end