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) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Data from contact custom fields not showing up on reports
Pages: [1]

Author Topic: Data from contact custom fields not showing up on reports  (Read 1829 times)

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Data from contact custom fields not showing up on reports
June 22, 2012, 09:07:45 am
In April I was at the User/Administrator's training in San Francisco and one of the trainers helped me out by adding a hook that allowed the custom data fields that I had added to contact information show up as fields that I could choose to make visible when I run an activity report. When I export the report to CSV these custom fields appear as columns on the spreadsheet but there is no data below. None of the information added to theses custom fields ever makes it to the reports. Does anybody know what I can do to fix this?

Thank you so much in advance for you help!

Maddie
National Clearinghouse on Abuse in Later Life

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Data from contact custom fields not showing up on reports
June 24, 2012, 05:23:06 am
I am not sure what trick you were taught? I could imagine if you use the hook you created you need to check if the name of the table is the same in your install as it was during the training? If that is not the case, can you post the hook here?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 24, 2012, 09:41:18 am
Here is the message from Michael McAndrew describing what was done:

You wanted to be able to search for activities based on custom data that extends the contact (as well as custom data that extends the activity). To do this I needed to customize a php file.  I followed the best practice for customising php files, which is...
 
1) create a new folder for you customisations - I created this at '/home8/wcadvlis/www/ncall_civicrm_custom_files/php/' and told CiviCRM where to find customisations on this screen: http://www.ncall.us/civicrm/admin/setting/path?reset=1
 
2) copy the file you want to customise (in this instance it was civicrm/CRM/Report/Form/Activity.php) to the customisations folder so it ends up at /home8/wcadvlis/wcadv/html/ncall_civicrm_custom_files/php/CRM/Report/Form/Activity.php
 
3) edited line 41 of the file...
 
It used to read
    protected $_customGroupExtends = array( 'Activity' );
It now reads
    protected $_customGroupExtends = array( 'Activity', 'Contact', 'Individual', 'Organization' );


So now when I go to run a report I have the option of turning this custom data on and when I export the report to CSV the custom data fields show up as columns on the spreadsheet but none of the data that has been inserted into these custom fields in the contact information shows up below. However, custom fields and data from activities DO appear.  Any idea what could be happening?

Thank you so much.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 12:09:46 am
OK, that sounds like good and sound advice from Michael McAndrew....I would not expect anything else from him :-)
You mention that the custom data for contacts does not show up in the columns on the spreadsheet, but does the data show up in the report in CiviCRM?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 05:10:39 am
Yes, he was very sweet and mighty helpful!

No, just like in the spreadsheet, the columns appear but the data that corresponds with these fields is nowhere to be found.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 05:38:45 am
Okay.....can you make a screen print of the custom data set definition, and one of the (empty) custom field definitions? And can you get to your database with a database management tool or am I now talking gibberish?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 09:37:44 am
Here is a description of the 5 screen-shots attached to these few posts:

1. The custom data settings for this set
2.  The settings for one of the custom fields within the set
3.  An empty new-individual form with the custom set (Grant Reporting Information) expanded
4. The report criteria I can choose from when I go to run a report with the custom set expanded and the fields within the set checked.
5. A test report with the custom fields from the set appearing (Discipline, If Other, specify, OVW Relation) with the data excluded. (Should read "Adult Protective Services" under discipline for this particular contact)


I am able to get to our database with a database management tool although I may need to call reinforcements.

Any ideas?

Again, thank you for your time.

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 09:38:41 am
Attachment 2

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 09:39:07 am
3

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 09:42:33 am
4

MadelineKasper

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.26
  • MySQL version: 5.1.63
  • PHP version: 3.4.10.2
Re: Data from contact custom fields not showing up on reports
June 25, 2012, 09:42:57 am
5

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Data from contact custom fields not showing up on reports
June 26, 2012, 12:20:59 am
Hi Madeline,
I will have time to have a look tonight (my time) and tomorrow night.....get back to you once I had a look!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Data from contact custom fields not showing up on reports
June 27, 2012, 05:25:59 am
Hi Madeline,

hmmm difficult without actually looking at the site (and the code itself). In your screen prints I did notice that the Discipline showed up, both contains no data for the contact? Or is that just a question of the print you made? Still, the column heading should show up. Is there a possibility to get access to the site, or alternatively do you have a support deal with Michael McAndrew so that he can log on to your site?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Data from contact custom fields not showing up on reports
July 18, 2012, 12:32:45 pm
Quote
Yes, he was very sweet and mighty helpful!
Thanks for the feedback :) and sorry I didn't get a chance to reply to your email yet.  Great job on posting about your issue here :)

I think I remember having this problem before.  It might be that CiviCRM thinks that the custom data applies to the 'source contact', not the 'target contact'.

You'll need to edit that /home8/wcadvlis/wcadv/html/ncall_civicrm_custom_files/php/CRM/Report/Form/Activity.php form some more.

I've attached a patch file which shows you the changes I made to that file last time I did this.  You might want to pass this on to your re-inforcements or have a go at making the changes yourself.  If you do it yourself, you might want to do a bit of googling on how to read a patch file, though it is pretty straight forward. It just tells you what line numbers are changed. What the old lines were and what the new ones are.

What ever approach you choose, make sure you make a back up :)

This patch was made against an older version 3.2 but fingers crossed the changes should be pretty much the same for your version.

Also, Pretty sure that it would be better to have it the way around that you want it by default. If this does solve the problem that you are having, you might want to file an issue and get it fixed for future versions.

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Data from contact custom fields not showing up on reports

This forum was archived on 2017-11-26.