net.sf.jasperreports.engine

## Interface JRSortField

- All Superinterfaces:
    java.lang.Cloneable, JRCloneable
  All Known Implementing Classes:
    JRBaseSortField, JRDesignSortField

      public interface JRSortField
      extends JRCloneable

  Provides support for in-memory field-based data source sorting.

  JasperReports supports in-memory field-based data source sorting. This functionality can be used, for instance, when data sorting is required and the data source implementation does not support it (as in the case of the CSV data source).

  The sorting is activated by the presence of one or more `<sortField>` elements in the report template. When at least one sort field is specified for the report, the original report data source (either passed directly or provided by a query executer) is passed to a sorted `IndexedDataSource` instance that fetches all the records from it, performs an in-memory sort according to the specified fields, and replaces the original data source in the report-filling process.

  The sort field name should coincide with a report field name. Fields used for sorting should have types that implement `java.util.Comparable`. Sorting will be performed using the natural order for all fields except those of type `java.lang.String`, for which a collator corresponding to the report fill locale is used.

  When several sort fields are specified, the sorting will be performed using the fields as sort keys in the order in which they appear in the report template.
  Version:
    $Id: JRSortField.java 7034 2014-04-22 10:49:26Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    `IndexedDataSource`, `DatasetSortUtil`, `SortedDataSource`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getName()` Gets the sort field name.
    `SortOrderEnum` | `getOrderValue()` Gets the sort order for the field.
    `SortFieldTypeEnum` | `getType()` Gets the type of the sort field.

    - ### Methods inherited from interface net.sf.jasperreports.engine.JRCloneable

      `clone`

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Gets the sort field name.

    - #### getOrderValue

          SortOrderEnum getOrderValue()

      Gets the sort order for the field.

    - #### getType

          SortFieldTypeEnum getType()

      Gets the type of the sort field.

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com