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) »
  • Include Contact's address in Relationship Report
Pages: [1]

Author Topic: Include Contact's address in Relationship Report  (Read 1279 times)

sachuit

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.beta2
  • CMS version: Joomla! 1.5.22 Stable
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Include Contact's address in Relationship Report
April 12, 2012, 10:47:44 pm
Hello,

Is there any way to include Contacts' addresses in Relationship Report?

Thank you.

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: Include Contact's address in Relationship Report
April 12, 2012, 11:57:19 pm
You would need to customise the report, you can find some guidelines here: http://book.civicrm.org/developer/the-extensions-framework/reports
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

sachuit

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.beta2
  • CMS version: Joomla! 1.5.22 Stable
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Re: Include Contact's address in Relationship Report
April 13, 2012, 12:01:44 am
Hi Erik,

I have just finished editing report and received your email. Thanks for heads up though.

Not sure why, but I had to comment below lines;

if ( !empty($this->_params['country_id_value']) ||
     !empty($this->_params['state_province_id_value']) ){

Below is the code I added in CRM/Report/Form/Contact/Relationship.php

'civicrm_address'  =>
    array( 'dao'       => 'CRM_Core_DAO_Address',
         'fields' =>
         array( 'street_address' =>
                array( 'title'  => ts('Street Address of Contact A'),
                       'name'   => 'street_address',
                       'default' => true, ),
                'city' =>
                array( 'title'  => ts('Suburb of Contact A'),
                       'name'   => 'city',
                       'default' => true, ),
                'postal_code' =>
                array( 'title'  => ts('Postcode of Contact A'),
                       'name'   => 'postal_code',
                       'default' => true, ),
                'state_province_id' =>
                array( 'title'  => ts('State of Contact A'),
                       'name'   => 'state_province_id',
                       'default' => true, ),),
         'filters'   =>             
         array( 'country_id' =>
                array( 'title'        => ts( 'Country' ),
                       'operatorType' => CRM_Report_Form::OP_MULTISELECT,
                       'options'      => CRM_Core_PseudoConstant::country(),
                       ),
                'state_province_id' => 
                array( 'title'        => ts( 'State/Province' ),
                       'operatorType' => CRM_Report_Form::OP_MULTISELECT,
                       'options'      => CRM_Core_PseudoConstant::stateProvince( ),
                       ),
                ),
         'grouping'  => 'contact-fields',
         ),

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: Include Contact's address in Relationship Report
April 13, 2012, 12:15:25 am
Looks fine, you could also use the API to retrieve the address. The advantage would be that the API would take care of changes in data or DAO, so you customization would still work with future versions.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Include Contact's address in Relationship Report

This forum was archived on 2017-11-26.