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) »
  • Including Custom Fields in OrderBy (Custom Report )
Pages: [1]

Author Topic: Including Custom Fields in OrderBy (Custom Report )  (Read 750 times)

darkchild

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 2
  • “…more than kisses, letters mingle souls…”- John D
  • CiviCRM version: 4.0.1
  • CMS version: joomla & drupal
  • MySQL version: 5.0.91
  • PHP version: 5.2.14
Including Custom Fields in OrderBy (Custom Report )
April 25, 2012, 02:06:04 pm
I am not sure if this was the right way to do it but faced with a need to include Custom fields in the Order By/ Header Grouping section of reports (and  limited knowledge), I ended up using the following line:

Code: [Select]
protected $_autoIncludeIndexedFieldsAsOrderBys = array( 'Activity', 'Case' );
The code can be placed under the $_customGroupExtends like this:
Code: [Select]
class CRM_Report_Form_ProgramSummary extends CRM_Report_Form {
   
protected $_customGroupExtends = array( 'Activity', 'Case' );
protected $_customGroupGroupBy = true;
protected $_autoIncludeIndexedFieldsAsOrderBys = array( 'Activity', 'Case' );


Hopefully this may be of use to someone  else.


ddunn

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal
  • MySQL version: 5.0.7-dev
  • PHP version: 5.3.4
Re: Including Custom Fields in OrderBy (Custom Report )
April 27, 2012, 02:24:29 am
This would be very handy for me. However I have even less knowledge, and I can't figure out which file this would sit in. Can you help? Thanks!

ddunn

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: Drupal
  • MySQL version: 5.0.7-dev
  • PHP version: 5.3.4
Re: Including Custom Fields in OrderBy (Custom Report )
April 27, 2012, 02:35:16 am
Got it, Thanks!

I put
Code: [Select]
    protected $_autoIncludeIndexedFieldsAsOrderBys = array( 'Participant' ); at line 48 of civicrm/CRM/Report/Form/Event/ParticipantListing.php

just under   
Code: [Select]
  protected $_customGroupExtends = array( 'Participant' );
Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Including Custom Fields in OrderBy (Custom Report )

This forum was archived on 2017-11-26.