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) »
  • a custom report template that will implement "Add these Contacts to Group"?
Pages: [1]

Author Topic: a custom report template that will implement "Add these Contacts to Group"?  (Read 1448 times)

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
a custom report template that will implement "Add these Contacts to Group"?
May 31, 2013, 08:17:37 am
I have written some custom report templates using custom views in the CiviCRM database, which produce reports of Contacts, which naturally have the buttons "Print Report", "PDF", "Export to CSV", which all work just fine.  Then there is a drop-list for selecting a group and a button "Add these Contacts to Group" which does nothing, ie does not all the contacts in the report to the selected group. 

The quite helpful guide on how to write custom report templates (for contacts and cases anyway) http://wiki.civicrm.org/confluence/display/CRMDOC43/CiviReport+Referencedoes not seem to touch upon this.  In fact, perhaps unsurprisingly, the example given as "Case 1" in that document will not add the displayed contacts to a group.

With the supplied report templates (eg Constituent Report (Detail) ) this feature works just fine (and produces a reassuring pop-up to say so).  I have looked through the code of the report template for this report and I can see no magic code which would obviously implement this function so I am obviously missing something, so would someone please give me a few pointers for where to look for the answer to this?

Thanks
Mark   :)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: a custom report template that will implement "Add these Contacts to Group"?
June 02, 2013, 08:51:35 pm
Is the postProcess function of your report file calling

Quote
$this->endPostProcess();

HTh
Kurund
Found this reply helpful? Support CiviCRM

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
Re: a custom report template that will implement "Add these Contacts to Group"?
June 02, 2013, 11:58:10 pm
It wasn't, it now is, but it is still not working.   :(

Mark

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: a custom report template that will implement "Add these Contacts to Group"?
June 03, 2013, 02:38:13 am
I guess you will have to debug, $this->endPostProcess(); has the code for "add contacts to group"

Kurund
Found this reply helpful? Support CiviCRM

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
Re: a custom report template that will implement "Add these Contacts to Group"?
June 03, 2013, 03:08:48 am
Oh, thanks Kurund!   :)
I was using a non-standard alias for the contact table in my report template.  I am now using 'civicrm_contact' and it works just fine!

Thanks again
Mark   :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • a custom report template that will implement "Add these Contacts to Group"?

This forum was archived on 2017-11-26.