Answers.Body: <p>Answering my own question: </p>
  
  <p>My fix was to edit a file in "all", which isn't ideal since it'll get overwritten when updating CiviCRM, but I can always re-apply it.</p>
  
  <p>Edit file: <code>sites/all/modules/civicrm/CRM/Report/Form/Contribute/History.php</code></p>
  
  <p>Change Line 61 from <code>$yearsInPast = 4;</code> to <code>$yearsInPast = 20;</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T06:48:47.957Z
Answers.Text: What I usually do when I need to change a core report a bit. Is to create an extension into which copy&paste the code of the core report and change it to my needs. 
  Also I would have changed the hardcoded variable into a filter option which could be set in the user interface.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T07:17:38.503Z
Answers.Text: As Jaap says, create an extension with a copy of the existing report then modify.  The `--copy` option on `civix generate:report` makes it very easy to get started.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-17T20:21:51.507Z
Answers.LastActivityDate: 2018-05-17T20:21:51.507Z
Answers.UserDisplayName: Eric H
Body: <p>TL;DR: I want Contribution Aggregate by Relationship to show more years in the past.</p>
  
  <p>I'm using the report "Contribution Aggregate by Relationship" to produce a report with columns for giving by year. However, it doesn't go back as many years as I'd like. I found how to control how many years it goes <em>forward</em> ("custom" date class in Settings - Date Preferences), but the same date class doesn't affect how far it goes back (three previous years then a catch-all for years before that). Is there something else that controls this? I need it to go back about 10 years or so.</p>
  
Tags: <reports><date-preferences>
Title: Dialing Contribution Aggregate by Relationship back a few year
ThreadText: # Dialing Contribution Aggregate by Relationship back a few year
  
  (Asked by: username_0 on 2018-05-17)
  
  TL;DR: I want Contribution Aggregate by Relationship to show more years in the past.
  
  I'm using the report "Contribution Aggregate by Relationship" to produce a report with columns for giving by year. However, it doesn't go back as many years as I'd like. I found how to control how many years it goes *forward* ("custom" date class in Settings - Date Preferences), but the same date class doesn't affect how far it goes back (three previous years then a catch-all for years before that). Is there something else that controls this? I need it to go back about 10 years or so.
  
  **Tags:** reports, date-preferences
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-05-17. Score: 1
  
  Answering my own question:
  
  My fix was to edit a file in "all", which isn't ideal since it'll get overwritten when updating CiviCRM, but I can always re-apply it.
  
  Edit file: `sites/all/modules/civicrm/CRM/Report/Form/Contribute/History.php`
  
  Change Line 61 from `$yearsInPast = 4;` to `$yearsInPast = 20;`
  
  > **Comments:**
  > **username_1**: What I usually do when I need to change a core report a bit. Is to create an extension into which copy&paste the code of the core report and change it to my needs.  Also I would have changed the hardcoded variable into a filter option which could be set in the user interface.  
  > **username_2**: As username_1 says, create an extension with a copy of the existing report then modify.  The `--copy` option on `civix generate:report` makes it very easy to get started.  
  
  ---
  
  