CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviReport proposal (on a shoestring version)
Pages: [1]

Author Topic: CiviReport proposal (on a shoestring version)  (Read 777 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
CiviReport proposal (on a shoestring version)
May 08, 2009, 03:06:29 am
Hi,

I often have reports to do, eg numbers of contacts group by country, number of contacts per tag, number of activities per contacts...

Nothing rocket science, basically a fat sql query and display the result in a table.

I'd like to add a simple framework, a la custom search, so you can create a custom report/dashboard in a few lines

/civicrm/report/custom/XXX.php

class civicrm_custom_report_XXX extends civicrm_custom_report {

setSQL () {
  return "SELECT sort_name as name, count(*) as total, bla bla FROM bla bla bla WHERE ...;";
}


and it would display the table with columns name+total+bla bla

and be called civicrm/reports?report=XXX&param...

does it make sense ? Would it be useful for someone else ?


X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviReport proposal (on a shoestring version)
May 08, 2009, 06:48:14 am

1. avoid using report :) that menu item has been taken for civireport. blog post on this coming soon

2. you can write a very slim wrapper around custom search which does the below in a few functions (i.e. the base class does most of the work)

3. in general folks will want more features once you have something simple, hence custom search is a better way, IMO. Also the two things are real similar and will confuse folks etc (and civireport will add to the confusion)

4. finally if you just want to execute a sql query, a drupal module might be a much faster way

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviReport proposal (on a shoestring version)

This forum was archived on 2017-11-26.