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 - custom fields
Pages: [1]

Author Topic: CiviReport - custom fields  (Read 1101 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
CiviReport - custom fields
August 24, 2010, 08:02:55 pm
I'm just trying to do some work on custom reports

In Civi Report using the customGroupExtends has a few nice features but it's kind of neck or nothing. Uncommenting this adds all contribution related custom fields to the report as display / filter options

Code: [Select]
protected $_customGroupExtends = array( 'Contribution' );
However, the report I am working on only needs a few custom fields (as aggregates). I wound up turning the above line off because if no custom fields are selected the table isn't added into the From Clause. So I made modifications to the From & Select clauses and the report is working.

However, one of the nice things about the function I turned off is that it converts the values in the custom fields back into the appropriate labels. It doesn't seem like I can easily use the functions for handling the custom data unless I turn it off.

I'm not sure the best approach to doing this label conversion - perhaps copying & modifying  alterCustomDataDisplay( &$rows )?
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

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: CiviReport - custom fields
August 24, 2010, 08:25:18 pm
Only searchable custom fields are listed in the report, so if possible you can make only those field are searchable which you want to show in report.
But if you want to add custom fields manually ( with commenting protected $_customGroupExtends = array( 'Contribution' ); )  you need to override function alterCustomDataDisplay( ) ( which used to replace values by label for custom data ) within your report.

Rajan

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviReport - custom fields
August 24, 2010, 10:12:48 pm
By over-ride - if I put that function in my report will something call it?
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

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: CiviReport - custom fields
August 24, 2010, 10:23:42 pm
Yes, this will be like override function alterDisplay( ), I think most of the reports we are overriding this function.Since we are calling this function through the current object ($this) so it first look this function in the current class if not present in the current class then look in the parent class :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviReport - custom fields

This forum was archived on 2017-11-26.