SLIDE 1
Custom Reports for CiviCRM: Not as hard as you might think. Default - - PowerPoint PPT Presentation
Custom Reports for CiviCRM: Not as hard as you might think. Default - - PowerPoint PPT Presentation
Custom Reports for CiviCRM: Not as hard as you might think. Default Linked text settings Anything. Anything Filters Grouping CiviReport does, you can do. Custom Display data columns Ordering Text Charts manipulation What you'll
SLIDE 2
SLIDE 3
What you'll need Good grasp of SQL. Basic understanding of Object-Oriented Programming. Decent IDE. Patience.
SLIDE 4
Getting started Documentation:
http://bit.ly/civireport_customize
SLIDE 5
Getting started Directories for custom templates and PHP files.
SLIDE 6
Getting started Extending CRM_Report_Form:
- Override an existing report; OR
- Create a completely new one.
SLIDE 7
Simple example: Add a column to an existing report.
SLIDE 8
Simple example: Add a column to an existing report.
$civicrm_root/CRM/Report/Form/Contact/Summary.php [custom_dir]/CRM/Report/Form/Contact/Summary.php
SLIDE 9
Simple example: Add a column to an existing report.
SLIDE 10
Simple example: Add a column to an existing report.
SLIDE 11
Creating a new report “A report showing the name and phone number of everyone who came to more than
- ne event last year.”
SLIDE 12
Creating a new report
SLIDE 13
Creating a new report
$civicrm_root/CRM/Report/Form/Event/ParticipantListing.php [custom_dir]/CRM/Report/Form/Event/ParticipantAggregate.php
SLIDE 14
Creating a new report
SLIDE 15
Creating a new report
$civicrm_root/templates/ CRM/Report/Form/Event/ParticipantListing.tpl [custom_dir]/templates/ CRM/Report/Form/Event/ParticipantAggregate.tpl
SLIDE 16
Creating a new report Register the new report template.
SLIDE 17
Creating a new report Register the new report template.
SLIDE 18
Creating a new report
SLIDE 19
$_columns array: 'fields': existing
SLIDE 20
$_columns array: 'fields': count
SLIDE 21
$_columns array: 'fields': phone
SLIDE 22
$_columns array: 'fields': phone
SLIDE 23
from( ) method: phone table
SLIDE 24
Quick debugging tip:
Print the actual report SQL to a status message, near the end of CRM_Report_Form::buildQuery( ) :
CRM_Core_Session::setStatus( "<pre>$sql</pre>" );
SLIDE 25
$_columns array: 'group_bys': Contact ID
SLIDE 26
$_columns array: 'filters': count
SLIDE 27
where( ) method
SLIDE 28
where( ) method
SLIDE 29
$_columns array: 'order_bys': postal code
SLIDE 30
alterDisplay( ) method:
SLIDE 31
Useful thing #1 Improved styles for printing reports: http://bit.ly/civireport_printstyle
SLIDE 32
Useful thing #2 User-private reports:
http://drupal.org/project/civicrm_private_report
SLIDE 33
Last thing, lots o' fun: Charts
SLIDE 34
Last thing, lots o' fun: Charts
SLIDE 35
Last thing, lots o' fun: Charts
SLIDE 36
Last thing, lots o' fun: Charts
CRM_Report_Form_Contribute_Summary CRM_Report_Form_Contribute_Sybunt CRM_Report_Form_Contribute_Lybunt
Examples in core reports:
SLIDE 37
Grouping Charts Filters Display columns Custom data Linked text Text manipulation Default settings Ordering
SLIDE 38