
Sorting report data
You can make the data displayed in either descending or ascending alphabetical order in a report.
Sorting data in charts
Data labels on the category or series axes of a chart can be sorted alphabetically. To do this, select the chart, right-click the icon
of the chart or right-click on the chart platform or paper, then on the shortcut menu, select Ascend or Descend from the Sort Category or Sort Series submenu.
To remove the sort condition, click No Sort on the Sort Category or Sort Series submenu.
Sorting data in crosstabs
You can make the records in a crosstab sorted based on any column or row field. To do this, right-click on any value on the column or row header, then choose the command Sort > Ascend or Sort > Descend from the shortcut menu. To remove the sort condition, click Sort > No Sort from the shortcut menu.
Sorting data in tables
You can sort the records or groups at a certain group level in a table.
- Sorting records: Changing the order of records in the whole table, or in each group if there are.
- Sorting groups at a group level: Changing the order of groups at the specified group level, that is, the groups will be sorted by value of the group field.
You can take the following ways to sort data in tables.
Using shortcut menu
- Right-click on any value of a detail field or group field by which to sort the data in the table.
- Choose the command Sort > Ascend or Sort > Descend from the shortcut menu.
- If a detail field value is clicked on, the sorting will affect the order of detail records in the table; if it is a group field value, the order of groups in the group level represented by the group field will be rearranged.
To remove the sort condition on a field, click Sort > No Sort from the shortcut menu.
Using labels
You can use labels to control the sorting order for certain fields in tables. This feature needs to be enabled at report design time.
- In JReport Designer, select a label in a table in a web report, and then set the Sortable property of the label to true.
- Set the field by which you want to sort records as the value of the label's Bind Column property.
- Save the report and publish it to JReport Server.
- Run the report in Web Report Studio. You can see a sort button
displayed beside the label.
- To sort the table based on the specified column values ascendingly, click the upward triangle; to sort the values descendingly, click the downward triangle.
After applying a sort order, the corresponding triangle will be highlighted. To remove the sort order, click the highlighted triangle.
Using server profile setting
You can also configure the server profile to enable sorting records in tables by clicking the sort button on table column headers.
- Open the Profile > Customize Profile > Common tab.
- Check the option Sort on Column Headers to enable clicking the sort button on column headers to sort table records (by default, this option is checked).
- Check Show Sort/Filter Status on Column Headers if you want the the sort button to be always displayed on the table column headers with the current sort status. If this option is unchecked, each time you want to get the sort button for a column, you need to put the mouse pointer on its header to make the button shown.
- Run a web report containing a table in Web Report Studio and you can click
on the table column headers to sort data.
To sort the table based on any column values ascendingly, click the upward triangle on the column; to sort the values descendingly, click the downward triangle. If the column is a group column, the order of groups in this group level will be rearranged.
When a sort order is applied, the corresponding triangle will be highlighted. To remove the sort order, click the highlighted triangle.
Notes:
- When sorting the data in a table by a field and then by another field, the later sort condition is the major order, and the former condition the minor order, that is to say, the records in the table will be sorted by the later sort condition first, then by the former sort condition.
- The Sort on Column Headers feature does not work on summary columns that contain multiple summary fields.
- When a table is designed with the Sort by Label feature in JReport Designer, if the Sort on Column Headers option is also enabled on the server profile, the settings defined in JReport Designer have the higher priority for the specified columns.
