Connecting Tech Pros Worldwide Help | Site Map

Ruby Reports

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 28th, 2008, 03:43 AM
Newbie
 
Join Date: Oct 2007
Posts: 19
Default Ruby Reports

Hello,
I am referring the link below for creating the ruby reports.For creation of report_table, query is used for selecting only particular table.If i query the report_table, am getting error as "undefined method slice! for Hash".

Ex:
1. Author.report_table(:all, :only => ['id','name'])
If i use like this.I am getting error.
2. Author.report_table
If i use like this,its working properly.

I want to select only particular column from table.Please help me to do this.Its urgent.Thanks




http://www.oreillynet.com/pub/a/ruby/2008/04/08/ruport-business-reporting-for-ruby.html?page=1
Reply
  #2  
Old June 30th, 2008, 02:38 PM
Expert
 
Join Date: May 2007
Posts: 209
Default

I know this isn't what the tutorial says, but you could try
Expand|Select|Wrap|Line Numbers
  1. Author.report_table(:all, :only => 'id, name')
At least, that is how the Active Record :select seems to work.
Reply
  #3  
Old July 2nd, 2008, 01:19 PM
Newbie
 
Join Date: Oct 2007
Posts: 19
Default

Quote:
Originally Posted by improvcornartist
I know this isn't what the tutorial says, but you could try
Expand|Select|Wrap|Line Numbers
  1. Author.report_table(:all, :only => 'id, name')
At least, that is how the Active Record :select seems to work.

Thanks for the reply. Even that is not working for me.
We can also use Author.report_table_by_sql("select .....")
Reply
  #4  
Old July 2nd, 2008, 02:12 PM
Expert
 
Join Date: May 2007
Posts: 209
Default

It stinks when tutorials don't work the same way they tell you to do something. I'm not sure what you can do in this case. It may be best just to use Author.report_table_by_sql("select .....").
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.