Ruport problems

D

darkintent

[Note: parts of this message were removed to make it a legal post.]

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?
 
A

Aaron Patterson

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!
 
D

darkintent

[Note: parts of this message were removed to make it a legal post.]

I got it to work now. had some extra spaces in it. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,129
Latest member
FastBurnketo
Top