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) »
  • Customizing report: limit returned rows how?
Pages: [1]

Author Topic: Customizing report: limit returned rows how?  (Read 801 times)

kharding

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 4
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 7
  • MySQL version: Recent
  • PHP version: 5.3.16
Customizing report: limit returned rows how?
July 16, 2012, 09:29:09 pm
Hi all,

I'm trying to customise the built-in Contact Summary report to return a "thumbnail" glance of recently added contacts, to be used both as a dashboard widget and as an emailed report.

My challenge is to return the 15 most recent added contacts. (I would love to be able to say "15 most recent in the past day" but that's beyond my abilities at the moment.)

As of now, I've managed to customise a report based on Contact Summary to enable Contact ID as an Order By and require it, so the report is already returning results ordered descending by contact ID.

Now, I just need to know how to add in a limit of 15 to the SQL, but I can't find out how. I can't even sort out how to debug the SQL.

I'm using the exact code from the Summary.php form - the forum will not allow me to enter in the code for review, saying I'm not allowed to post links.

Assistance?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Customizing report: limit returned rows how?
July 17, 2012, 12:28:09 am
Try defining

 $this->limit = 15;

in the class / construct part of your report
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

kharding

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 4
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 7
  • MySQL version: Recent
  • PHP version: 5.3.16
Re: Customizing report: limit returned rows how?
July 17, 2012, 09:41:36 am
Eileen - thank you. That worked!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Customizing report: limit returned rows how?

This forum was archived on 2017-11-26.