CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Is a user-selectable ORDER BY filter possible?
Pages: [1]

Author Topic: Is a user-selectable ORDER BY filter possible?  (Read 631 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Is a user-selectable ORDER BY filter possible?
January 03, 2011, 06:41:56 pm
Is there a way to set ORDER BY clause in the user's filter interface?  Is there an existing report that has this functionality?  Maybe I missed it, but I couldn't find one.

I can hardcode an ORDER BY in function groupBy( ) , I get that much, but I want to have several different ORDER BY options and have the user select the one they want.

Possible?  Thanks.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Is a user-selectable ORDER BY filter possible?
January 03, 2011, 08:08:11 pm
I think I looked into this once and I didn't see it either. I ended up hijacking groupBy and using the selected groupings for ordering instead, but yes there's no way to get the user to specify the primary vs secondary etc ordering. There isn't with grouping either really.

There's also this, in case you didn't already see it.
http://forum.civicrm.org/index.php/topic,15272.0.html

It's awkward, but what you might be able to do is set up the fake grouping options to be the combined ordering and use that in groupBy, e.g.

Checkbox 1: Order by date, name, city
Checkbox 2: Order by date, city, name
Checkbox 3: Order by name, city, date
etc.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Is a user-selectable ORDER BY filter possible?

This forum was archived on 2017-11-26.