Skip to main content

Alphabetize selected attributes for report

Comments

4 comments

  • Ryan Cooney

    Hi Gail,

    If you edit the report in Manager there is an "Order By" option that allows you to specify the sort order of the data for the report. It uses the same formatting as a SQL Order By clause.

    This feature was added in Essentials 4.0.

    --Ryan

    0
  • Permanently deleted user

    Would either of you be able to elaborate with an example of how you implemented the Order By clause. So far, I have been unable to successfully have my records sorted when the report prints using ORDER BY * fieldname * DESC;

    Do I need to be including the SELECT * FROM as well?

    Thanks,

    Warren

    0
  • Ryan Cooney

    Hi Warren,

    All you need is "FIELDNAME DESC ". Don't include "ORDER BY" and don't include a trailing semicolon.

    The way this is implemented is we have the report data in a System.Data.DataTable. We then invoke this method  DataTable.Select(string filterExpression, string sort)  https://msdn.microsoft.com/en-us/library/way3dy9w(v=vs.110).aspx  with your order by clause as the "sort" parameter.

     

    --Ryan

    0
  • Permanently deleted user

    Warren,

    You can also add a script to your report and add the following component:

     

    public void ActiveReport_DataInitialize()

     

    {

     

    rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "ARN ASC");

     

    }

     

     

    ARN is the name of the field you can sort on.

    Walter

    0

Please sign in to leave a comment.