-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We usually use Gruff (http://nubyonrails.com/pages/gruff) for the charts
and we just write the Sqlite queries by hand. It's so nice when you just
push the results to a dryml "<table>" :).

By the way, spreadsheet + OpenOffice in server mode are a powerful
combination for XLS/PDF exports.

Regards,
Ignacio

For these kind of reports we use Gruff for the charts

El 31/05/11 14:01, Owen escribió:
> Has any one in the group tried Ruport?
> 
> http://www.rubyreports.org/
> 
> 
> 
> 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
> 

- -- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk304uAACgkQBPlUJ6RHaOSZUACg8HteW9K/8b2KQBbWX3rStep7
QzYAnAgjouRSbxu8vIUTrS4KsHOl6few
=hQKg
-----END PGP SIGNATURE-----

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