Answers.Body: <p>The default reporting does not cater for sorting status and role. One way to achieve this is by writing code as Pradeep suggested. Another way is to export the report data to Excel (csv) and do the sorting in Excel. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T17:15:08.990Z
Answers.Text: +1 because the question asker described themselves as "newbie user" and this answer takes that into account.
Answers.UserDisplayName: Phil Morice Brubaker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T07:54:10.737Z
Answers.LastActivityDate: 2019-01-16T07:54:10.737Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.Body: <p>Similar to Pradeep's answer, yet another option is to clone the report and modify it - see <a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report</a> specifically 
  <code>civix generate:report --copy</code></p>
  
  <p>You could then publish your report as a new extension or submit a PR to enhance the core report.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-17T19:51:11.050Z
Answers.Text: This looks like where I need to be headed! But I can't yet understand it In the the link [here][1],  I wouldn't know where I would even type "civix generate:report --help" to activate this. I know SQL well, and will need to be doing lots of modifying to Civi's reports (or connect to the underlying data and use Access or Tableau). In order to understand these answers, is PHP what I would need to learn? (The list of [useful skills][2] is long)
  
    [1]: https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report
    [2]: https://docs.civicrm.org/dev/en/latest/basics/skills/
Answers.UserDisplayName: CiviLearner
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T16:02:45.670Z
Answers.LastActivityDate: 2019-01-16T16:02:45.670Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>Existing report in CiviCRM for participant doesn't provide sorting based on participant status and role. Probably best solution would be to add some code to implement <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterReportVar/" rel="nofollow noreferrer">hook_civicrm_alterReportVar</a> through extension and define sorting fields in $var['civicrm_participant]['order_bys'] when $varType == 'columns'.</p>
  <p>Cheers</p>
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T07:52:38.927Z
Answers.Text: This answer assumes that someone could write code and understand the report class. There is no alternative.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T00:42:10.310Z
Answers.LastActivityDate: 2019-01-16T00:42:10.310Z
Answers.LastEditDate: 2020-06-17T09:00:50.810Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>In the sorting tab for event participation reports, I can't sort by role or status. Even those these are built-in fields that it seems obvious people would want sort by, are not in the list of columns- I'm a newbie user, so I suspect it's something easy and I just don't see it??? I'd like the report to be sorted first by status, then by role, but I'd take at least one of two. Please advise, thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T19:47:35.407Z
Comments.Text: Thanks for the prompt responses! 
  
  So my take-home is: It's not just me missing something simple, you actually can't sort even basic event participation reports by participant role or participant event status within Civi. Sigh. As I'm not a developer, I don't understand the other options, but they look very informative and I trust others will benefit from them.
Comments.UserDisplayName: CiviLearner
Tags: <civireport>
Title: Sort report by event role and/or status
ThreadText: # Sort report by event role and/or status
  
  (Asked by: username_0 on 2019-01-15)
  
  In the sorting tab for event participation reports, I can't sort by role or status. Even those these are built-in fields that it seems obvious people would want sort by, are not in the list of columns- I'm a newbie user, so I suspect it's something easy and I just don't see it??? I'd like the report to be sorted first by status, then by role, but I'd take at least one of two. Please advise, thanks!
  
  **Tags:** civireport
  
  > **Comments:**
  > **username_0**: Thanks for the prompt responses!   So my take-home is: It's not just me missing something simple, you actually can't sort even basic event participation reports by participant role or participant event status within Civi. Sigh. As I'm not a developer, I don't understand the other options, but they look very informative and I trust others will benefit from them.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-01-16. Score: 2
  
  The default reporting does not cater for sorting status and role. One way to achieve this is by writing code as username_4 suggested. Another way is to export the report data to Excel (csv) and do the sorting in Excel.
  
  > **Comments:**
  > **username_2**: +1 because the question asker described themselves as "newbie user" and this answer takes that into account.  
  
  ---
  
  ### Answer by username_3 on 2019-01-16. Score: 1
  
  Similar to username_4's answer, yet another option is to clone the report and modify it - see <https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report> specifically
  `civix generate:report --copy`
  
  You could then publish your report as a new extension or submit a PR to enhance the core report.
  
  > **Comments:**
  > **username_0**: This looks like where I need to be headed! But I can't yet understand it In the the link [here][1],  I wouldn't know where I would even type "civix generate:report --help" to activate this. I know SQL well, and will need to be doing lots of modifying to Civi's reports (or connect to the underlying data and use Access or Tableau). In order to understand these answers, is PHP what I would need to learn? (The list of [useful skills][2] is long)    [1]: https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report   [2]: https://docs.civicrm.org/dev/en/latest/basics/skills/  
  
  ---
  
  ### Answer by username_4 on 2019-01-16. Score: 0
  
  Existing report in CiviCRM for participant doesn't provide sorting based on participant status and role. Probably best solution would be to add some code to implement [hook\_civicrm\_alterReportVar](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterReportVar/) through extension and define sorting fields in $var['civicrm\_participant]['order\_bys'] when $varType == 'columns'.
  
  Cheers
  
  username_4
  
  > **Comments:**
  > **username_1**: This answer assumes that someone could write code and understand the report class. There is no alternative.  
  
  ---
  
  