Author Topic: Using order_bys parameter in reports  (Read 1849 times)

Offline lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Using order_bys parameter in reports
« on: August 23, 2010, 11:05:12 am »
reports includes a parameter that can be built into templates for ordering the results -- order_bys

but the only report it is currently (partially) implemented on is the walklist report, which for some reason is default disabled.

the function itself does seem to work. you can add order_bys to the column construction array, insert the function as found in the walklist report, and if necessary pass to postProcess (for simple reports postProcess is handled automatically, so you don't need to pass the clause), and the report will be sorted.

but currently the default criteria.tpl file does not accommodate any selection of the order clause. and i'm unsure if the array options would be passed to the template correctly. currently if i add multiple order_bys it sorts by all of them in the order defined. hopefully they're handled by the template such that one can select a single order by field, or can choose multiple optional fields.

mostly i'm curious what the status is for this piece of the reports implementation. i'm actually surprised it hasn't come up before.
support CiviCRM through 'make it happen' initiatives!