3

I've got the request to display (certain) groups in the membership detail report. A lot has been written over time about customizing reports, and I'm not sure what info is up-to-date. This looks good: https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/

I think roughly, I would need to

  • set up the paths for custom templates and php files at setting/path
  • create a custom template with just a single {include file="CRM/Report/Form.tpl"}
  • create a custom php file copied from CRM/Report/Form/Member/Detail.php
  • register both using Administer –> CiviReport –> Manage Templates
  • in the php file, append stuff to _columns and from()

is that correct ? Has anyone already done something like this for groups .. ?

3
  • as Lobo points out below, this is the legacy way of doing it.
    – commonpike
    Commented Jun 2, 2015 at 10:36
  • having said that, I did it just as described, and it was fairly easy :-)
    – commonpike
    Commented Jun 2, 2015 at 10:37
  • having said that, I created an extension to do this later, and it was fairly easy too :-)
    – commonpike
    Commented Oct 17, 2017 at 13:04

2 Answers 2

4

The current correct way to create a custom report is to use an extension, rather than the manual process linked to in the question.

Updated documentation for creating a report extension is found here:

https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report

The link in Donald Lobo's answer is now broken, but an old version of the document is still available here:

https://wiki.civicrm.org/confluence/display/CRMDOC46/Create+a+Report-Template+Extension

3

A better approach might be to use an extension rather than the above. Documentation for report extensions here:

http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Report-Template+Extension

You might be able to borrow some code from other reports which show the groups a contact belongs to (not sure if any report does so)

1
  • ew, there you go, I already used the 'legacy' way of creating a report :-/ I dont think any of the default reports show groups for contacts.
    – commonpike
    Commented Jun 2, 2015 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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