From: Aaron Patterson Date: 2009-08-27T03:35:48+09:00 Subject: Re: Ruport problems On Wed, Aug 26, 2009 at 01:16:28PM +0900, darkintent@gmail.com wrote: > I have tried the following code with Ruport 1.6.1: > require "rubygems" > require "ruport" > > > table=Ruport::Data::Table.load( "foo.csv",:has_names=>true) > grouping = Ruport::Data::Grouping(table, :by => "name") > grouping.save_as("foo.pdf") > ---------------------------------------------------------------- > I get the following errors: > > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/table.rb:695:in > `column': ArgumentError (ArgumentError) > from > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/grouping.rb:110:in > `grouped_data' > from > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/grouping.rb:173:in > `send' > from > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/grouping.rb:173:in > `initialize' > from > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/grouping.rb:386:in > `new' > from > /usr/lib64/ruby/gems/1.8/gems/ruport-1.6.1/lib/ruport/data/grouping.rb:386:in > `Grouping' > > ------------------------------------------------------------------------------------------------------------ > > > The csv file is just a copy paste of the example file of the same name used > on Rubyreports.org. It seems to print to the terminal normally but when I > try to group the data I end up getting the above error. Any ideas on what > the problem could be? Did you make sure that the CSV file has a header? I am able to reproduce your error if I remove the header from the CSV file. Make sure your test CSV file looks like this: me,login time,machine Gregory,10:00,bittle Joe,11:45,soda Jim,9:00,kitten Joe,12:15,soda Gregory,5:00,kitten Joe,12:45,bittle Hope that helps! -- Aaron Patterson http://tenderlovemaking.com/