BTW, another tool we use a great deal is TOAD for MySQL:

http://www.quest.com/toad-for-mysql/

I have been using the Oracle version for over a decade.  There is a
nice query builder that allows you to easily join tables and
experiment until you have what you want, they it will give the SQL
code.

Of course, recently there is Arel and MetaWhere, which look promising:

http://www.railsdispatch.com/posts/activerelation
http://metautonomo.us/projects/metawhere/


On May 31, 11:51 am, Owen Dall <[email protected]> wrote:
> For pixel-perfect reporting we tend to use iReport from JasperSoft.  It does
> require a JVM to execute, but as of yet we have not found a good substitute.
>
> Anyone else?
>
> -Owen
>
>
>
>
>
>
>
>
>
> On Tue, May 31, 2011 at 10:56 AM, Walter Davis <[email protected]> wrote:
>
> > On May 31, 2011, at 8:01 AM, Owen wrote:
>
> >  Has any one in the group tried Ruport?
>
> >>http://www.rubyreports.org/
>
> > Wow, that looks really nice, and timely, too. I wonder if it works with
> > Rails 3.x yet? (Example code in the Web site referred to "add the gem
> > require to your environment.rb", so I'm not sure.
>
> > Walter
>
> >> On May 31, 5:52 am, Piotroslav <[email protected]> wrote:
>
> >>> Greetings,
>
> >>> I am trying to generate some reports that requires to join some
> >>> models.
>
> >>> My models are:
> >>> Lead
>
> >>>   has_many :engineers, :through => :offers
> >>>>>  has_many :offers, :accessible => true
> >>>>>  has_many :projects, :accessible => true
> >>>>>  has_many :bidforms, :accessible => true
> >>>>>  belongs_to :contact
> >>>>>  belongs_to :user, :class_name => "User", :creator => true
>
> >>> User
>
> >>>   has_many :calls
> >>>>>  has_many :companies
> >>>>>  has_many :projects
> >>>>>  has_many :leads
> >>>>>  has_many :signoffs
> >>>>>  has_many :todos
> >>>>>  belongs_to :access_role
>
> >>> Contact
>
> >>>   belongs_to :user, :class_name => "User", :creator => true
> >>>>>  belongs_to :company
> >>>>>  has_many :calls
> >>>>>  has_many :leads, :accessible => :true
>
> >>> Calls
>
> >>>   belongs_to :contact
> >>>>>  belongs_to :user, :class_name => "User", :creator => true
>
> >>> Company
>
> >>>   has_many :projects, :accessible => :true
> >>>>>  has_many :contacts, :accessible => :true
> >>>>>  belongs_to :user, :class_name => "User", :creator => true
> >>>>>  has_many :calls, :through => :contacts
>
> >>> Some of reports to generate are:
> >>> *A report that show the number of calls, to the number of contacts,
> >>> with the number of leads in the last quarter (e.g. would say for
> >>> example Vodafone Group services, 27 calls to 12 contacts with 2 leads)
> >>> *A report which allows you to list all calls by a salesperson over a
> >>> user defined time period
>
> >>> So what I figured out is I need to create named_scope.
> >>> To generate report that shows all calls from users within last quarter
> >>> I do:
> >>> named_scope :show_calls, :from => "(select *, (select count(*) from
> >>> calls where user_id=users.id and created_at >= '" +
> >>> (Date.commercial(Date.today.year, Date.today.cweek, 1) - 11 *
> >>> 7).strftime("%Y-%m-%d") + "' and result != 'nocall') as total_calls
> >>> from users) users", :conditions => "total_calls > 0"
>
> >>> But I do not know how to generate report which (like in first example)
> >>> joins multiple models (in this example Company with Call, Contact and
> >>> Lead model), nor how to vary report (like in second exaple by user
> >>> specified dates)
>
> >>> Thank you in advance!
> >>> Kind regards,
> >>>  Piotr Stepniak
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Hobo Users" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected].
> >> For more options, visit this group at
> >>http://groups.google.com/group/hobousers?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Hobo Users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/hobousers?hl=en.
>
> --
> Owen Dall, Chief Systems Architect
> Barquin Internationalwww.barquin.com
> Cell: 410-991-0811

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to