Author Topic: sorting and section headers for reports  (Read 2069 times)

Offline TwoMice

  • I post frequently
  • ***
  • Posts: 213
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
sorting and section headers for reports
« on: October 23, 2010, 09:34:11 pm »
It's great to see we're using jQuery DataTables sorting for report output now (i.e., instant header-click sorting by column).

It would also be nice to build in some configurable sorting options that would support, say, multi-column sorting.   It would be even cooler to add in support for section headers with totals (which would depend on the sorting to work properly).

This would let us turn something like this (sorted by size only, in one long list)

+-------------------------+
| SIZE   | ID     | FRUIT |
+--------+--------+-------+
| Large  | 1      | kiwi  |
+--------+--------+-------+
| Large  | 3      | apple |
+--------+--------+-------+
| Small  | 4      | plum  |
+--------+--------+-------+
| Small  | 8      | kiwi  |
+--------+--------+-------+
| Small  | 11     | apple |
+--------+--------+-------+

into something like this (sorted by size and fruit, and sectioned by size with total counts per section):

+-----------------+
| SIZE: Large (2) |
+-----------------+
| ID     | FRUIT  |
+--------+--------+
| 3      | apple  |
+--------+--------+
| 1      | kiwi   |
+-----------------+
| Size: Small (3) |
+-----------------+
| ID     | FRUIT  |
+-----------------+
| 11     | apple  |
+--------+--------+
| 8      | kiwi   |
+--------+--------+
| 4      | plum   |
+--------+--------+


In a not-too-recent thread, Lobo guessed 40-50 hours for getting generalized sorting into the reporting framework.  We may be interested in building and submitting a patch for the sorting feature, and possibly something in support of section headers as well. 

Does anyone want to offer their thoughts on the value of these features?  And possibly any pointers on potential headaches to watch out for?

Thanks,
TM
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Offline TwoMice

  • I post frequently
  • ***
  • Posts: 213
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: sorting and section headers for reports
« Reply #1 on: October 25, 2010, 02:35:55 pm »
For reference, this is moving forward, as explained in this blog post:
http://blog.civicrm.org/blogs/allenshaw/adding-sort-columns-reports
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.