Question

We'd like a sort of overview report regarding our petitions in CiviCRM. It would be great to have two pie charts, one showing contacted and signed % and contacted but not signed %, and another pie chart showing the results of our one-question poll (Yes, No, Maybe).

Ideally the charting would be integrated into CiviCRM so we don't need to do custom code to get charts every time we run a poll.

I can't find anything to do this on the CiviCRM forums and my question there is unanswered.

Would this be better done in Drupal Webforms?

Was it helpful?

Solution

This is probably a job for a custom report template. The issue is that you're not just looking at petition signature activities; you're comparing that against being "contacted". CiviCRM won't know off the bat what you mean by that. Is it receiving an email? Having a phone call activity? Having any activity in X campaign?

The custom report template would need to extend the activity report to include contacts who are involved in two activities: being "contacted" and signing the petition. Really, it's not a report of petition signatures--many won't have signed anything--it's a report of being "contacted", so you'll need to be able to filter out what that is (and distinguish these activities from being contacted with a different ask).

You'll need to have the report template make joins from the "contacted" activity to the civicrm_activity_contact table, then to the same table (to find other activities the same contact is involved with), then to the civicrm_activity table again to get the petition signatures. Once you have the basics working there, you can add in columns and filters, and after that, you can give the report a pie chart display.

Once you have all this set up (and it is a bit significant--my shop would charge for 5-10 hours of work), you could use the regular interface to pick which petition and what criteria should be used for identifying those being "contacted". You could have a bunch of saved report instances for that single template, so you wouldn't need to write any new code unless a CiviCRM upgrade interfered with things.

Here's the reference for how to create custom report templates: http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Report-Template+Extension

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top