Alphabetize selected attributes for report
I have created a report that exports to a pdf document. The trouble I am having is that I need the selected results to be alphabetized in the final report. Any ideas on how to make this happen? I tried sorting the attributes of the field in the mxd, and when I go back in to the mxd I can see they are still alphabetized. What I am noticing is that the report sorts the selected records by the Object ID not by the field that I need. When I use the selection tool in the Geocortex mapviewer I can alphabetize the recorrds, but that does not carry over to the report. Your thoughts and feed back would be awesome.
Thanks,
Gail
-
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 -
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 -
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 -
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.
Comments
4 comments