Answers.Body: <p>Over-riding core file would be last thing we should do unless there are no other option, since you need to port the file in each incremental upgrade.</p>
  <p>Instead I would do one of the below</p>
  <ol>
  <li><p>To add filtes, fields etc to report i would implement <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterReportVar/" rel="nofollow noreferrer">hook_civicrm_alterReportVar</a> via extension or module or plugin</p>
  </li>
  <li><p>If the requirement is too complex than i would create new report file extending Repeat Contribution report(see <a href="https://gist.github.com/pradpnayak/f9589797dca332ca6e87a2b8fc3af64e" rel="nofollow noreferrer">example</a>)</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-19T07:23:26.813Z
Answers.LastActivityDate: 2020-10-19T07:23:26.813Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I need a particular type of report which I could not find in core or extended reports.</p>
  <p>So I thought of modifying the core report PHP and place it in custom PHP directory. I have manage to add &quot;payment instrument&quot; filter to this particular report.</p>
  <pre><code>        'payment_instrument_id' =&gt; array(
          'title' =&gt; ts('Payment Instrument'),
          'type' =&gt; CRM_Utils_Type::T_INT,
          'operatorType' =&gt; CRM_Report_Form::OP_MULTISELECT,
          'options' =&gt; CRM_Contribute_PseudoConstant::paymentInstrument(),
        ),
  </code></pre>
  <p>However, I need to add another item to the group to filter the result limited to recurring contribution. It could be a checkbox or a Yes/No. Can anyone suggest how can I add it please? Thanks</p>
  
Tags: <civireport><reports><custom-reports>
Title: How can I add a "Recurring" filter to core "Repeat contribution" report?
ThreadText: # How can I add a "Recurring" filter to core "Repeat contribution" report?
  
  (Asked by: username_0 on 2020-10-18)
  
  I need a particular type of report which I could not find in core or extended reports.
  
  So I thought of modifying the core report PHP and place it in custom PHP directory. I have manage to add "payment instrument" filter to this particular report.
  
  ```
          'payment_instrument_id' => array(
          'title' => ts('Payment Instrument'),
          'type' => CRM_Utils_Type::T_INT,
          'operatorType' => CRM_Report_Form::OP_MULTISELECT,
          'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
        ),
  
  ```
  
  However, I need to add another item to the group to filter the result limited to recurring contribution. It could be a checkbox or a Yes/No. Can anyone suggest how can I add it please? Thanks
  
  **Tags:** civireport, reports, custom-reports
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-19. Score: 2
  
  Over-riding core file would be last thing we should do unless there are no other option, since you need to port the file in each incremental upgrade.
  
  Instead I would do one of the below
  
  1. To add filtes, fields etc to report i would implement [hook\_civicrm\_alterReportVar](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterReportVar/) via extension or module or plugin
  2. If the requirement is too complex than i would create new report file extending Repeat Contribution report(see [example](https://gist.github.com/pradpnayak/f9589797dca332ca6e87a2b8fc3af64e))
  
  
  ---
  
  