2

I have created some custom fields for Contacts and want to display these fields in a membership report that we call member mailing list. However I am unable to see the custom fields for Contacts as display columns in the report even though they are marked as searchable

enter image description here

  • Do you see any core contact field in the columns? first_name, last_name, etc? – jitendra - fuzion Apr 10 '18 at 10:07
  • Yes I can see the core contact fields. Just not the custom ones – Vish Ramakonar Apr 10 '18 at 10:08
  • can you share the screenshot of the report criteria? – jitendra - fuzion Apr 10 '18 at 10:10
2

If you can open the report file from your codebase, you can add the entity name to the _customGroupExtends variable array initialized at the top of the file of almost every report in CiviCRM.

protected $_customGroupExtends = array('Contact');

The above line will include all contact custom set in your report. You can add Individual, Membership to display custom group extending these entities too.

To see which file is used for the report, you can refresh the result to get a Developer tab which contains the class name used to display the result.

enter image description here

So the file which is used in above report is -

/path_to_civicrm/CRM/Report/Form/Member/Detail.php

  • ok great I will try this and let u know if it works. Thank you – Vish Ramakonar Apr 10 '18 at 10:33
  • Hi Jitendra.how do I locate the file for this report to update the code? Sorry Im having trouble finding it – Vish Ramakonar Apr 12 '18 at 0:08
  • updated the answer to locate the file for the report – jitendra - fuzion Apr 12 '18 at 3:01
  • Great - you can accept this answer with a green tick to complete this question on SE. – jitendra - fuzion Apr 15 '18 at 5:25
2

Look for custom fields in a fieldset below the ‘standard’ report fields - here’s an example for another type of report - but clearly shows the custom data sets (if they have been marked searchable in the custom data set configuration) as fieldsets in the report - click them open and you’ll see the custom fileds

enter image description here Second thought: Extended Report extension: https://civicrm.org/extensions/extended-reports - you can download/install it from your Manage Extensions screen. It introduces a number of report templates - some of which will have many customfields extended (in fieldsets) so no core code edit required.

  • Thanks KarinG we already have extended reports but couldnt find one that meets our criteria. The current report is showing me custom fields for memberships but I need to access the custom fields for Contacts – Vish Ramakonar Apr 10 '18 at 13:57
  • In that case you’lll have to either make the edit Jitendra mentions above directly in core or add a custom_php override and just override that report – KarinG - Semper IT Apr 11 '18 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.