Using 4.6.10 currently, although aiming to update shortly, I've created a case summary report from the template that simply lists all cases that are either 'ongoing' or 'urgent'. This lists 10 cases. All good.

However, if I then use 'Cases' > 'Find Cases' and specify the exact same criteria (i.e. find all cases with the status 'ongoing' or 'urgent', it lists 14 cases.

Comparing the two results lists and looking for differences between the cases that might explain the difference in results, I can see none. We have only one case type, and all the cases as listed in the civicrm_case table carry the same case type id, they are all open and not deleted, the status id values marry up as I would expect, and I can see no differences that might lead to these four cases not being included in my report.

My assumption/conclusion is that the case summary report template is in some way broken in this version? As I say I'm about to update to the current 4.6.x version (4.6.14 at the time of writing), but wondering if others have had odd results with the Case Summary Report, or indeed the 'Find Cases' search facility?

2 Answers 2


The Case Summary report has a grouping on contact. Do two or more of the cases have the same client?

  • 1
    I don't know why it has a grouping on contact. The original one (CiviCRM 3.1?) didn't. And the UI no longer seems to even display the grouping option? You'd only want to group if you were doing something like displaying the count of cases per client. I'd say change $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_c2']}.id"; to $this->_groupBy = ""; in CRM/Report/Case/Form/Summary.php in the groupBy() function and see if that fixes it.
    – Demerit
    Commented Mar 24, 2016 at 20:08
  • Thanks Demerit, this might well resolve my issue. As it is, the report as viewed as a dashlet gives zero indication that any grouping might be occurring, with the effect that it shows an incorrect display, so I'd say, in this version at least, it's a bug. I'll try to reproduce on the demo site.
    – Graham
    Commented Mar 25, 2016 at 12:44
  • I can repeat this issue on both the 4.6 and 4.7 demo sites. Logged at issues.civicrm.org/jira/browse/CRM-18294 and included your suggested solution.
    – Graham
    Commented Mar 25, 2016 at 13:11
  • Update: making the edit as suggested to CRM/Report/Form/Case/Summary,php (note the path change) results in the report displaying many thousands of repeat entries (in my case I expected 14 cases to be listed and got 10140 listed instead, with multiple repeats.
    – Graham
    Commented Mar 25, 2016 at 13:28
  • 1
    Looks like there's also been an "old-style" join added in the from() function that shouldn't be there. In the else clause, try changing "FROM civicrm_contact $c, civicrm_case $cc" to "FROM civicrm_case $cc".
    – Demerit
    Commented Mar 26, 2016 at 0:17

As a result of the input from Demerit, for which many thanks, it seems clear that the Case Summary Report presents inaccurate – or at least potentially misleading – results, arising from the apparent grouping by contact, which is not made clear in the UI.

Making the two suggested changes to the file at CRM/Report/Form/Case/Summary.php as noted in the comments resolves the issue for me, aligning the results from the Case Summary Report with a search based on the same filters/criteria.

This was logged at issues.civicrm.org/jira/browse/CRM-18294

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.