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) »
  • How do we reference custom fields in a report?
Pages: [1]

Author Topic: How do we reference custom fields in a report?  (Read 1130 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
How do we reference custom fields in a report?
June 01, 2010, 03:00:59 pm
I've been setting up a custom report template and have seen how to add custom fields using the following lines (in my case, using participant custom fields):
Code: [Select]
   protected $_customGroupExtends = array( 'Participant' );
   protected $_customGroupGroupBy = true;

Now, what this seems to do is bring in all searchable custom fields to all sections of the report (Display Columns, Group columns, filters).  How can I then reference a specific custom field in the rest of the php code, so I can do things like set a default value in the filter or maybe rename it's title, etc?

I tried using custom_<ID> (ex: 'custom_4'), but that didn't seem to work - I could not change the title of the field, for example.

If anyone has a block of code referencing custom fields (or even a full report example), I'd appreciate it.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • How do we reference custom fields in a report?

This forum was archived on 2017-11-26.