report grouping syntax for sorting by group for multiple fields
in many cases, there is a need for multiple groupby phrases (group heading). In the documentation for the report writer, it states that the groupby sorting is not done automatically. the example in the documentation only shows a sort for one field.
here is the guidance from the report writer document:
"Note that it is very important that data being grouped is sorted on the grouping field. This sorting does not occur automatically - it must be done inside a report script. While many complex tasks can be performed using scripting, scripting only a sort of the records in the data is straightforward. The simplest method of doing this is by copying the script text below into the Script tab in Geocortex Report Designer, and replacing FIELDNAME with the name of the column on which your report is to be grouped:
public void ActiveReport_DataInitialize() { rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "FIELDNAME"); } "
I have not been able to include syntax for sorting on multiple fields, such as
groupby state, groupby county, groupby city.
each one of those would presumably need to be sorted or selected as per the single item. but i get an error if i attempt that.
rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "STATE");
rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "County");
rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "City");
produces an error.
so being the newbee that i am in C#, i need some help with getting the syntax correct when there are multple groupby (groupheadings) required in a report. also, why doesn't the groupby do the sorting and dissolving for you?
Jeff
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer