module Ruport

controller/table.rb : Tabular data controller for Ruby Reports

Written by Gregory Brown, December 2006. Copyright 2006, All Rights Reserved This is Free Software, please see LICENSE and COPYING for details.

Ruport : Extensible Reporting System

controller/grouping.rb : Group data controller for Ruby Reports

Written by Michael Milner, 2007. Copyright (C) 2007, All Rights Reserved

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Ruport : Extensible Reporting System

formatter/csv.rb provides csv formatting for Ruport.

Original code dates back to the earliest versions of Ruport in August 2005 Extended over time, with much of the existing code being added around December 2006.

Copyright (C) 2005-2007 Gregory Brown, All Rights Reserved.

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Ruport : Extensible Reporting System

formatter/text.rb provides text formatting for Ruport.

Created by Gregory Brown, some time around Spring 2006. Copyright (C) 2006-2007, All Rights Reserved.

Mathijs Mohlmann and Marshall T. Vandegrift have provided some patches for this class, see AUTHORS file for details.

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Ruport : Extensible Reporting System

formatter/html.rb provides html formatting for Ruport.

Created by Gregory Brown, late 2005. Updated numerous times as needed to fit new formatting systems.

Copyright (C) 2005-2007 Gregory Brown, All Rights Reserved.

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Ruport : Extensible Reporting System

formatter/pdf.rb provides text formatting for Ruport.

Created by Gregory Brown, February 2006 Extended by James Healy, Fall 2006 Copyright (C) 2006-2007 Gregory Brown / James Healy, All Rights Reserved.

Initially inspired by some ideas and code from Simon Claret, with many improvements from James Healy and Michael Milner over time.

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Ruport : Extensible Reporting System

formatter.rb provides a generalized base class for creating ruport formatters.

Created By Gregory Brown Copyright (C) December 2006, All Rights Reserved.

This is free software distributed under the same terms as Ruby 1.8 See LICENSE and COPYING for details.

Constants

VERSION

Public Class Methods

Table(*args,&block) click to toggle source

Shortcut interface for creating Data::Tables

Examples:

t = Table(%w[a b c])   #=> creates a new empty table w. cols a,b,c
t = Table("a","b","c") #=> creates a new empty table w. cols a,b,c

# allows building table inside of block, returns table object
t = Table(%w[a b c]) { |t| t << [1,2,3] }

# allows loading table from CSV
# accepts all Data::Table.load options, including block (yields table,row)

t = Table("foo.csv")
t = Table("bar.csv", :has_names => false)
# File lib/ruport/data/table.rb, line 1043
def self.Table(*args,&block)
  case(args[0])
  when Array
    opts = args[1] || {}
    Ruport::Data::Table.new(f={:column_names => args[0]}.merge(opts),&block)
  when /\.csv/
    Ruport::Data::Table.load(*args,&block)
  when Hash
    if file = args[0].delete(:file)
      Ruport::Data::Table.load(file,args[0],&block)
    elsif string = args[0].delete(:string)
      Ruport::Data::Table.parse(string,args[0],&block)
    else
      Ruport::Data::Table.new(args[0],&block)
    end
  else
     Ruport::Data::Table.new(:data => [], :column_names => args,&block)
  end
end