Answers.Body: <p>That's because the Activity report specifically hides the field in question.</p>
  
  <p>Use one of the many methods of customization (PHP override directory, extension, etc.) to edit <code>CRM/Report/Form/Activity.php</code>.</p>
  
  <p>There's a separate column for the Source, Assignee, and Target contact IDs - find the stanza that looks like:</p>
  
  <pre><code>      'contact_target_id' =&gt;
        array(
          'name' =&gt; 'id',
          'alias' =&gt; 'civicrm_contact_target',
          'dbAlias' =&gt; "civicrm_contact_target.id",
          'no_display' =&gt; TRUE,
          'default' =&gt; TRUE,
          'required' =&gt; TRUE,
        ),
  </code></pre>
  
  <p>Change it to be this:</p>
  
  <pre><code>        'contact_target_id' =&gt; array(
            'name' =&gt; 'id',
            'alias' =&gt; 'civicrm_contact_target',
            'dbAlias' =&gt; "civicrm_contact_target.id",
            'title' =&gt; "Target ID",
            'default' =&gt; TRUE,
          ),
  </code></pre>
  
  <p>Do that for the other two contacts and you're good.</p>
  
  <p>Note that this may cause you to get a bunch of notices that alterDisplay isn't working correctly - this is changing the names of some variables that are used to turn contact names into links.  You can ignore those notices if that functionality's not important - if it is, you may want to continue tweaking this a bit!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T17:29:29.853Z
Answers.LastActivityDate: 2015-05-11T17:29:29.853Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Can CiviCRM's internal contact ID be exposed in reports?</p>
  
  <p>It doesn't look as though we can select it in the display columns listing for an activity report. (CiviCRM 4.5.8)</p>
  
Tags: <civireport>
Title: Can CiviCRM's internal contact ID be exposed in reports?
ThreadText: # Can CiviCRM's internal contact ID be exposed in reports?
  
  (Asked by: username_0 on 2015-05-11)
  
  Can CiviCRM's internal contact ID be exposed in reports?
  
  It doesn't look as though we can select it in the display columns listing for an activity report. (CiviCRM 4.5.8)
  
  **Tags:** civireport
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-11. Score: 3 | Accepted answer
  
  That's because the Activity report specifically hides the field in question.
  Use one of the many methods of customization (PHP override directory, extension, etc.) to edit CRM/Report/Form/Activity.php.
  There's a separate column for the Source, Assignee, and Target contact IDs - find the stanza that looks like:
        'contact_target_id' =>
        array(
          'name' => 'id',
          'alias' => 'civicrm_contact_target',
          'dbAlias' => "civicrm_contact_target.id",
          'no_display' => TRUE,
          'default' => TRUE,
          'required' => TRUE,
        ),
  
  Change it to be this:
          'contact_target_id' => array(
            'name' => 'id',
            'alias' => 'civicrm_contact_target',
            'dbAlias' => "civicrm_contact_target.id",
            'title' => "Target ID",
            'default' => TRUE,
          ),
  
  Do that for the other two contacts and you're good.
  Note that this may cause you to get a bunch of notices that alterDisplay isn't working correctly - this is changing the names of some variables that are used to turn contact names into links.  You can ignore those notices if that functionality's not important - if it is, you may want to continue tweaking this a bit!
  
  
  ---
  
  