Ruby Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divyakgowda
    New Member
    • Oct 2007
    • 19

    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_t able(:all, :only => ['id','name'])
    If i use like this.I am getting error.
    2. Author.report_t able
    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
  • improvcornartist
    Recognized Expert Contributor
    • May 2007
    • 303

    #2
    I know this isn't what the tutorial says, but you could try
    Code:
    Author.report_table(:all, :only => 'id, name')
    At least, that is how the Active Record :select seems to work.

    Comment

    • divyakgowda
      New Member
      • Oct 2007
      • 19

      #3
      Originally posted by improvcornartis t
      I know this isn't what the tutorial says, but you could try
      Code:
      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_t able_by_sql("se lect .....")

      Comment

      • improvcornartist
        Recognized Expert Contributor
        • May 2007
        • 303

        #4
        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_t able_by_sql("se lect .....").

        Comment

        Working...