This video shows how to control the sort order of a Jasper Reports Crosstab using a Parameter.
Java Class Notes
To use the Java class mentioned in the example, create a toplevel directory like C:/classes. Next, add the required folder structure for the Java class (create folders for each path elements): com/bekwam/blog/sort. Finally, download the Java class file from the Bekwam web server:
Alternatively, compile the Java class available here: DynaSortComparator.java.
Next, point iReport to the toplevel class folder you created. DO NOT SET THE CLASSPATH TO THE com, bekwam, blog, or sort subfolders.
|Setting Classpath in iReport|
The .class file I provided works only with Java 1.7. I'll put up a backward-compatible version, but you can resolve this yourself by compiling your own version if you have a JDK available.
To check if a JDK is available type 'javac version' at a command prompt.
Here are the instructions on compiling DynaSortComparator.java for your version.
1. Save the source file in the "sort" folder created for the class file. (com/bekwam/blog/sort)
2. Change into the sort folder
3. Run the command > javac DynaSortComparator.java
This will replace the downloaded class file with one specific to your system.