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) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Custom Reports in Drupal by just adding embedding a Database Query into a page
Pages: [1]

Author Topic: Custom Reports in Drupal by just adding embedding a Database Query into a page  (Read 6801 times)

roballen

  • Guest
Custom Reports in Drupal by just adding embedding a Database Query into a page
September 15, 2008, 03:07:57 am
Hi,

I was looking for a very simple way of generating simple custom reports that are not covered by custom serach - Sorry - the Birt approach is just too over the top for a simple shared hosting set up.

I am a Joomla person but now prefer to use Drupal for CiviCRM (Yes I would probably use LQM for Joomla)

So I looked around to see what was on Drupal and I came across this Tip --> http://michaelosmith.com/node/5  --> Basically it says that you can include output from SQL queries into page content.

Is this correct? - if so then surely it is an easy procedure to set up a few dynamic SQL queries as and when required -  This is also a Drupal integrated route. Ok I accept that it is not formated for printing but I am sure that it would not be a huge task to create a CSV file based upon the query together with a download link.

Any thoughts?

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Custom Reports in Drupal by just adding embedding a Database Query into a page
September 15, 2008, 03:27:50 am
Hey,

Answering your question, it is correct - you can embed PHP code together with SQL queries in Drupal pages (refer to Drupal documentation for details), and you can interact with CiviCRM using API or directly with it's database. As for making those queries dynamic and providing a CSV download, it seems a bit complicated to me (better to write a custom search or separate Drupal module), but that probably depends on your PHP/SQL skills and Drupal API knowledge more than anything else.

If you prepare such custom reports, please consider sharing your way of doing this with community on this forum and/or wiki.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

chyatt

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
Re: Custom Reports in Drupal by just adding embedding a Database Query into a pa
February 04, 2009, 09:02:57 am
I recently used this approach and wrote up the results in my blog:

http://chyatt.ca/blog/2009/02/04/quick-and-dirty-civievent-reports-in-drupal5/

C

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Custom Reports in Drupal by just adding embedding a Database Query into a pa
February 04, 2009, 11:11:39 am
We did some work with BIRT and with CiviCRM's custom reports, but ultimately found it was much faster to produce reports directly in Drupal via API calls or SQL. I'll try to post some code samples for you to look at soon - please DM me if you wish to get it sooner.
@xurizaemon ● www.fuzion.co.nz

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Custom Reports in Drupal by just adding embedding a Database Query into a page
February 13, 2009, 04:36:47 pm
I have been able to do PHP/SQL reports in Drupal but it is probably better to write a module to do this, as I have been advised. Even to do embedded PHP/SQL reports, one must know the Drupal APIs to get the most value.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Custom Reports in Drupal by just adding embedding a Database Query into a page

This forum was archived on 2017-11-26.