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
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Custom Reports for CiviCRM: Not as hard as you might think.

slide-2
SLIDE 2

Anything CiviReport does, you can do. Grouping Charts Filters Display columns Custom data Linked text Text manipulation Default settings Ordering Anything.

slide-3
SLIDE 3

What you'll need Good grasp of SQL. Basic understanding of Object-Oriented Programming. Decent IDE. Patience.

slide-4
SLIDE 4

Getting started Documentation:

http://bit.ly/civireport_customize

slide-5
SLIDE 5

Getting started Directories for custom templates and PHP files.

slide-6
SLIDE 6

Getting started Extending CRM_Report_Form:

  • Override an existing report; OR
  • Create a completely new one.
slide-7
SLIDE 7

Simple example: Add a column to an existing report.

slide-8
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
SLIDE 9

Simple example: Add a column to an existing report.

slide-10
SLIDE 10

Simple example: Add a column to an existing report.

slide-11
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
SLIDE 12

Creating a new report

slide-13
SLIDE 13

Creating a new report

$civicrm_root/CRM/Report/Form/Event/ParticipantListing.php [custom_dir]/CRM/Report/Form/Event/ParticipantAggregate.php

slide-14
SLIDE 14

Creating a new report

slide-15
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
SLIDE 16

Creating a new report Register the new report template.

slide-17
SLIDE 17

Creating a new report Register the new report template.

slide-18
SLIDE 18

Creating a new report

slide-19
SLIDE 19

$_columns array: 'fields': existing

slide-20
SLIDE 20

$_columns array: 'fields': count

slide-21
SLIDE 21

$_columns array: 'fields': phone

slide-22
SLIDE 22

$_columns array: 'fields': phone

slide-23
SLIDE 23

from( ) method: phone table

slide-24
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
SLIDE 25

$_columns array: 'group_bys': Contact ID

slide-26
SLIDE 26

$_columns array: 'filters': count

slide-27
SLIDE 27

where( ) method

slide-28
SLIDE 28

where( ) method

slide-29
SLIDE 29

$_columns array: 'order_bys': postal code

slide-30
SLIDE 30

alterDisplay( ) method:

slide-31
SLIDE 31

Useful thing #1 Improved styles for printing reports: http://bit.ly/civireport_printstyle

slide-32
SLIDE 32

Useful thing #2 User-private reports:

http://drupal.org/project/civicrm_private_report

slide-33
SLIDE 33

Last thing, lots o' fun: Charts

slide-34
SLIDE 34

Last thing, lots o' fun: Charts

slide-35
SLIDE 35

Last thing, lots o' fun: Charts

slide-36
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
SLIDE 37

Grouping Charts Filters Display columns Custom data Linked text Text manipulation Default settings Ordering

slide-38
SLIDE 38