Answers.Body: <p>If you have a report that doesn't show the custom fields on an entity, it might be because those fields are not configured as searchable (yes, a very non-obvious thing). If that's the issue, then it's the same as this question/answer: <a href="https://civicrm.stackexchange.com/questions/19612/custom-fields-in-the-report-templates">Custom fields in the Report Templates</a></p>
  
  <p>Alternatively, if it's a problem with the report itself, you can generally hack it with something like the below at the top of the class file:</p>
  
  <pre><code> protected $_customGroupExtends = array(
      'Contact',
      'Individual',
      'Contribution',
    );
  </code></pre>
  
  <p>If you're seeing some custom fields but not the ones for Contributions, just adding in the Contribution entry to your current values should work.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T17:17:58.477Z
Answers.LastActivityDate: 2019-10-30T17:17:58.477Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>If you open the file that provides the report, you can generally add the custom fields with a single line.</p>
  
  <p>For instance, if you're using <a href="https://civicrm.org/extensions/extended-reports" rel="nofollow noreferrer">Extended Reports</a> extension, the "Extended Report - Participant Line Items" report template is a good one to add contribution custom fields to.</p>
  
  <p>So, for instance, find the files for Extended Report.  You can find their server location thusly:</p>
  
  <ul>
  <li>Go to <strong>Administer menu » System Settings » Extensions</strong>.</li>
  <li>Click the triangle next to <em>ExtendedReport</em> to see expanded info (see screenshot).</li>
  <li>Note the <em>local path</em> listed.</li>
  </ul>
  
  <p>On your server, go to that folder, then navigate to the subfolder <code>CRM/Extendedreport/Form/Report/Event</code> and open the <code>ParticipantExtended.php</code> file.</p>
  
  <p>You'll see this at the top (line 15):</p>
  
  <pre><code>  protected $_customGroupExtends = array(
      'Participant',
      'Contact',
      'Individual',
      'Event',
    );
  </code></pre>
  
  <p>Insert <code>'Contribution',</code> anywhere inside those parentheses (e.g. after <code>'Event',</code>) save, and reload the report.  You should have contribution custom fields.</p>
  
  <p>This change will be overwritten when you upgrade Extended Reports - but if you test it, it works, and you believe it's a useful addition, ping me on chat.civicrm.org (name in my bio) and I'll submit it to the author as an improvement.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T02:03:15.223Z
Answers.Text: Thanks, i just checked Extended Report Extesion (v4.5) on CIVICRM (5.13.5, Wordpress 5.0) and it looks like it shows the custom fields for Contacts and Participants Record but not the Contribution Records.  :( .  Or am i missing something ?  Thanks.
Answers.UserDisplayName: Clement Leong
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T20:00:42.923Z
Answers.Text: Ah, you're right.  I'll update this answer.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T20:09:28.080Z
Answers.Text: I also see that Alan provided the same answer in not as many words :)
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-05T03:58:32.753Z
Answers.Text: Thanks to all.  I have tried as Jon's suggestion and the custom fields appeared in Extended Report - Participant Template instead of the Extended Report - Participant Line Items template.  However, when i was trying to gen a report with the Participant Template to show the said custom field, it would complain of a DB Error.  Thanks for any further advice.
Answers.UserDisplayName: Clement Leong
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-12T15:16:41.567Z
Answers.Text: That sounds like a separate issue.  Enable debugging/backtrace, trigger the DB error, and open a new question that includes both the error and backtrace?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T14:35:32.250Z
Answers.LastActivityDate: 2019-10-30T20:08:47.847Z
Answers.LastEditDate: 2019-10-30T20:08:47.847Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Is it possible (via extension perhaps) to get a custom field from a related contribution record to be included in a Event Report ?  For example, in a paid event registration, this would create a associated contribution record and a custom field created in the contribution record.  How can I do a Event report which will include the Contribution record custom field ?  the current Report function doesn't seem to allow that.  Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-28T12:12:54.107Z
Comments.Text: Please clarify the name of the report template you're using?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T08:54:00.257Z
Comments.Text: Actually no particular Event Report template, it seems that all of them does not allow for custom fields of the associated Contribution Record to be included in the report.  Thanks.
Comments.UserDisplayName: Clement Leong
Tags: <custom-fields><reports>
Title: Event Reporting to call out Custom Fields in related Contribution Record
ThreadText: # Event Reporting to call out Custom Fields in related Contribution Record
  
  (Asked by: username_0 on 2019-10-27)
  
  Is it possible (via extension perhaps) to get a custom field from a related contribution record to be included in a Event Report ? For example, in a paid event registration, this would create a associated contribution record and a custom field created in the contribution record. How can I do a Event report which will include the Contribution record custom field ? the current Report function doesn't seem to allow that. Thanks.
  
  **Tags:** custom-fields, reports
  
  > **Comments:**
  > **username_1**: Please clarify the name of the report template you're using?  
  > **username_0**: Actually no particular Event Report template, it seems that all of them does not allow for custom fields of the associated Contribution Record to be included in the report.  Thanks.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-10-30. Score: 2
  
  If you have a report that doesn't show the custom fields on an entity, it might be because those fields are not configured as searchable (yes, a very non-obvious thing). If that's the issue, then it's the same as this question/answer: Custom fields in the Report Templates
  Alternatively, if it's a problem with the report itself, you can generally hack it with something like the below at the top of the class file:
   protected $_customGroupExtends = array(
      'Contact',
      'Individual',
      'Contribution',
    );
  
  If you're seeing some custom fields but not the ones for Contributions, just adding in the Contribution entry to your current values should work.
  
  
  ---
  
  ### Answer by username_1 on 2019-10-29. Score: 0
  
  If you open the file that provides the report, you can generally add the custom fields with a single line.
  For instance, if you're using Extended Reports extension, the "Extended Report - Participant Line Items" report template is a good one to add contribution custom fields to.
  So, for instance, find the files for Extended Report.  You can find their server location thusly:
  
  Go to Administer menu » System Settings » Extensions.
  Click the triangle next to ExtendedReport to see expanded info (see screenshot).
  Note the local path listed.
  
  On your server, go to that folder, then navigate to the subfolder CRM/Extendedreport/Form/Report/Event and open the ParticipantExtended.php file.
  You'll see this at the top (line 15):
    protected $_customGroupExtends = array(
      'Participant',
      'Contact',
      'Individual',
      'Event',
    );
  
  Insert 'Contribution', anywhere inside those parentheses (e.g. after 'Event',) save, and reload the report.  You should have contribution custom fields.
  This change will be overwritten when you upgrade Extended Reports - but if you test it, it works, and you believe it's a useful addition, ping me on chat.civicrm.org (name in my bio) and I'll submit it to the author as an improvement.
  
  > **Comments:**
  > **username_0**: Thanks, i just checked Extended Report Extesion (v4.5) on CIVICRM (5.13.5, Wordpress 5.0) and it looks like it shows the custom fields for Contacts and Participants Record but not the Contribution Records.  :( .  Or am i missing something ?  Thanks.  
  > **username_1**: Ah, you're right.  I'll update this answer.  
  > **username_1**: I also see that Alan provided the same answer in not as many words :)  
  > **username_0**: Thanks to all.  I have tried as Jon's suggestion and the custom fields appeared in Extended Report - Participant Template instead of the Extended Report - Participant Line Items template.  However, when i was trying to gen a report with the Participant Template to show the said custom field, it would complain of a DB Error.  Thanks for any further advice.  
  > **username_1**: That sounds like a separate issue.  Enable debugging/backtrace, trigger the DB error, and open a new question that includes both the error and backtrace?  
  
  ---
  
  