Friday, September 13, 2013

Adding Sorting By Report Column

One of the most desirable features of many reports is the ability to immediately sort the rows based on a specific column. Logi Studio makes the implementation of this sorting capability almost effortless.

To allow sorting by column in a report, add a Sort element to the desired Data Table Column element and set its Data Column attribute to the column used to sort the rows (i.e. CompanyName). In addition, it is sometimes necessary, based on the column data type, to set the Data Type attribute to specify the type of data being sorted.

Figure 2.24: Definition Editor Panel after adding Sort element

Note that the Data Column value does not use a token but instead uses the actual column name from the table and that Sort is one of the few elements that doesn’t have an ID.

Figure 2.25: Attribute Panel after setting Sort element attributes
You could even sort by more than one column. Simply set the Data Column attribute value to a list of column names separated by commas.

The result should look similar to the section of the report below:

Figure 2.26: Report Preview Panel
Clicking the Customer Name header sorts the report in ascending order by company name. Each time the header is clicked, the sort order toggles between ascending and descending, as shown below:

Figure 2.27: Sort order changed after header clicked
Hint: The default sort sequence is Ascending but this can be configured using the First Sort Sequence attribute.  

No comments:

Post a Comment