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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Can we add custom fields to reports without creating custom templates?
Pages: [1]

Author Topic: Can we add custom fields to reports without creating custom templates?  (Read 662 times)

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Can we add custom fields to reports without creating custom templates?
February 28, 2014, 08:09:36 pm
I'm looking to add some custom fields to the detailed contribution reports.

In the past I've done this by cloning the /CRM/Report/Form/Contribute/Detail.php file and putting it in my custom templates directory. Is there a way I can do this in my extension without a custom template?

ie: it there a hook I can use to add my fields to the fields array in the CRM_Report_Form_Contribute_Detail class?

Thanks,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Can we add custom fields to reports without creating custom templates?
March 11, 2014, 10:15:51 am
I didn't get any replies to this question but I've done a lot of digging and searching and I'm pretty sure that the answer is no.

In order to create truly custom reports you need to at the very least create a custom report template and let CiviCRM know about it via a custom extension or by putting it in your custom templates directory as defined by your admin -> system settings -> directories.

Hopefully this is helpful to someone else who has the same question.
« Last Edit: March 11, 2014, 05:41:07 pm by awasson »
My CiviCRM Extension Workshop: https://github.com/awasson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Can we add custom fields to reports without creating custom templates?

This forum was archived on 2017-11-26.